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
Public Instance Methods
@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
@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
@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
@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
@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
@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