Class: Saxon::XSLT::Transformation Private

Inherits:
Object
  • Object
show all
Defined in:
lib/saxon/xslt/executable.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.

Represents a loaded XSLT transformation ready to be applied against a context node.

Constant Summary collapse

VALID_OPTS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

A list of valid option names for the transform

[:raw, :mode, :global_context_item, :global_parameters, :initial_template_parameters, :initial_template_tunnel_parameters]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Transformation

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.

Returns a new instance of Transformation.



230
231
232
233
234
235
236
237
# File 'lib/saxon/xslt/executable.rb', line 230

def initialize(args)
  @s9_transformer = args.fetch(:s9_transformer)
  @destination = args.fetch(:destination, nil)
  @opts = args.reject { |opt, _|
    [:s9_transformer, :destination].include?(opt)
  }
  @raw = false
end

Class Method Details

.default_initial_templateSaxon::QName

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.

Return the default initial template namne for XSLT 3 named-template invocation

Returns:



225
226
227
# File 'lib/saxon/xslt/executable.rb', line 225

def self.default_initial_template
  @default_initial_template ||= Saxon::QName.clark('{http://www.w3.org/1999/XSL/Transform}initial-template')
end

Instance Method Details

#apply_templates(source) ⇒ 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.

Apply templates to Source, using all the context set up when we were created.



241
242
243
# File 'lib/saxon/xslt/executable.rb', line 241

def apply_templates(source)
  transformation_invocation(:applyTemplates, source.to_java)
end

#call_function(function_name, args) ⇒ 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.

Call the named function, using all the context set up when we were created.



253
254
255
256
# File 'lib/saxon/xslt/executable.rb', line 253

def call_function(function_name, args)
  function_name = Saxon::QName.resolve(function_name).to_java
  transformation_invocation(:callFunction, function_name, function_args(args))
end

#call_template(template_name) ⇒ 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.

Call the named template, using all the context set up when we were created.



247
248
249
# File 'lib/saxon/xslt/executable.rb', line 247

def call_template(template_name)
  transformation_invocation(:callTemplate, resolve_template_name(template_name))
end