Class: Saxon::XSLT::EvaluationContext::DSL Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Common

#args_hash, #initialize

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

Parameters:

  • block (Proc)

    a Proc/lambda (or to_proc‘d containing DSL calls

Returns:



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.

Parameters:

  • collation_uri (String)

    The URI of the Collation to set as the default



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).

Parameters:

See Also:



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.

Parameters:

See Also:



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.

Parameters:

See Also:



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 XDM::Values: Saxon::XDM::Value, Saxon::XDM::Node, and Saxon::XDM::AtomicValue, or as Ruby objects which will be converted to Saxon::XDM::AtomicValues in the usual way.

Parameters:



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