class XTemplate::XMLDocument
Public Class Methods
Source
# File lib/xtemplate/xml.rb, line 352 def initialize(text) @hash = nil case text when XNode @node = text when Hash,Array @node = XNode.new() value_to_xml(text, @node) else @node = parse(text) @node.prepare(nil, {:@type => true, :include => true, :template => true}) end end
Public Instance Methods
Source
# File lib/xtemplate/xml.rb, line 382 def [](path) root = to_hash() xpath(path,root) end
Source
# File lib/xtemplate/xml.rb, line 366 def parse(text) XMLParser.new.parse(text) end
Source
# File lib/xtemplate/xml.rb, line 370 def strip!(recursive=true) @node.strip!(recursive) end