Class: Saxon::XSLT::EvaluationContext::DSL Private
- Inherits:
-
Object
- Object
- Saxon::XSLT::EvaluationContext::DSL
- Includes:
- Common
- Defined in:
- lib/saxon/xslt/evaluation_context.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Provides the hooks for constructing a Saxon::XSLT::EvaluationContext with a DSL.
Class Method Summary collapse
-
.define(block, args = {}) ⇒ Saxon::XSLT::EvaluationContext
private
Create an instance based on the args hash, and execute the passed in Proc/lambda against it using
#instance_execand return a new Saxon::XSLT::EvaluationContext with the results.
Instance Method Summary collapse
-
#default_collation(collation_uri) ⇒ Object
private
Set the default Collation to use.
-
#global_parameters(parameters = {}) ⇒ Object
private
Set the values for global parameters (those that are available to all templates and functions).
-
#initial_template_parameters(parameters = {}) ⇒ Object
private
Set the values for parameters made available only to the initial template invoked (either via apply_templates or call_template), effectively as if
<xsl:with-param tunnel="no">was being used. -
#initial_template_tunnel_parameters(parameters = {}) ⇒ Object
private
Set the values for tunneling parameters made available only to the initial template invoked (either via apply_templates or call_template), effectively as if
<xsl:with-param tunnel="yes">was being used. -
#static_parameters(parameters = {}) ⇒ Object
private
Set the value for static parameters (those that must be known at compile-time to avoid an error), as a hash of QName => Value pairs.
Methods included from Common
Class Method Details
.define(block, args = {}) ⇒ Saxon::XSLT::EvaluationContext
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create an instance based on the args hash, and execute the passed in Proc/lambda against it using #instance_exec and return a new Saxon::XSLT::EvaluationContext with the results
59 60 61 62 63 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 59 def self.define(block, args = {}) dsl = new(args) dsl.instance_exec(&block) unless block.nil? EvaluationContext.new(dsl.args_hash) end |
Instance Method Details
#default_collation(collation_uri) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the default Collation to use. This should be one of the special collation URIs Saxon recognises, or one that has been registered using Saxon::Processor#declare_collations on the Processor that created the Compiler this context is for.
71 72 73 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 71 def default_collation(collation_uri) @default_collation = collation_uri end |
#global_parameters(parameters = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the values for global parameters (those that are available to all templates and functions).
96 97 98 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 96 def global_parameters(parameters = {}) @global_parameters = @global_parameters.merge(process_parameters(parameters)).freeze end |
#initial_template_parameters(parameters = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the values for parameters made available only to the initial template invoked (either via apply_templates or call_template), effectively as if <xsl:with-param tunnel="no"> was being used.
108 109 110 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 108 def initial_template_parameters(parameters = {}) @initial_template_parameters = @initial_template_parameters.merge(process_parameters(parameters)) end |
#initial_template_tunnel_parameters(parameters = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the values for tunneling parameters made available only to the initial template invoked (either via apply_templates or call_template), effectively as if <xsl:with-param tunnel="yes"> was being used.
120 121 122 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 120 def initial_template_tunnel_parameters(parameters = {}) @initial_template_tunnel_parameters = @initial_template_tunnel_parameters.merge(process_parameters(parameters)) end |
#static_parameters(parameters = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set the value for static parameters (those that must be known at compile-time to avoid an error), as a hash of QName => Value pairs. Parameter QNames can be declared as Strings or Symbols if they are not in any namespace, otherwise an explicit QName must be used. Values can be provided as explicit XdmValues: Saxon::XdmValue, Saxon::XdmNode, and Saxon::XdmAtomicValue, or as Ruby objects which will be converted to Saxon::XdmAtomicValues in the usual way.
86 87 88 |
# File 'lib/saxon/xslt/evaluation_context.rb', line 86 def static_parameters(parameters = {}) @static_parameters = @static_parameters.merge(process_parameters(parameters)).freeze end |