module Transform

All public methods can be invoked by a transform element; please hide methods you don’t want users to invoke in Private

Attributes

source[R]

Public Instance Methods

content(node) click to toggle source

@param node [Element, String] XML node including Strings @return [Array[String, Element]] array of child nodes of target

# File lib/con_duxml/transform.rb, line 38
def content(node)
  node.respond_to?(:nodes) ? node.nodes : node
end
copy(path) click to toggle source

@param path [String] path to node from @source @return [Element] a deep copy of the target(s)

# File lib/con_duxml/transform.rb, line 51
def copy(path)
  @source.locate(add_name_space_prefix path).collect do |node|
    node.dclone
  end
end
element(*args) click to toggle source

@param *args [*several_variants] see Duxml::Element#new; the only difference here is that this method has access to the content source

so the arguments can pass in the needed data

@return [Element] new element to replace old one

# File lib/con_duxml/transform.rb, line 45
def element(*args)
  Element.new(*args)
end
find_source(node) click to toggle source

@param node [Element] XML node from transform output @return [Element] XML node that provided content for transformation i.e. source

# File lib/con_duxml/transform.rb, line 32
def find_source(node)
  find_xform_event(node).input
end
find_transform(node) click to toggle source

@param node [Element] XML node from transform output @return [Element] XML node that contains instructions for transform used to create given @param node

# File lib/con_duxml/transform.rb, line 26
def find_transform(node)
  find_xform_event(node).instructions
end
find_xform_event(node) click to toggle source

@param node [Element] XML node from transform output @return [TransformClass] transform event object from output Doc’s history

# File lib/con_duxml/transform.rb, line 20
def find_xform_event(node)
  @output.history #TODO find transform whose outputs include given node
end