class XTemplate::XMLDocument

Public Class Methods

new(text) click to toggle source
# File lib/xtemplate/xml.rb, line 353
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

[](path) click to toggle source
# File lib/xtemplate/xml.rb, line 383
def [](path)
  root = to_hash()
  xpath(path,root)
end
parse(text) click to toggle source
# File lib/xtemplate/xml.rb, line 367
def parse(text)
  XMLParser.new.parse(text)
end
strip!(recursive=true) click to toggle source
# File lib/xtemplate/xml.rb, line 371
def strip!(recursive=true)
  @node.strip!(recursive)
end
to_hash() click to toggle source
# File lib/xtemplate/xml.rb, line 375
def to_hash()
  @node.to_hash()
end
to_s() click to toggle source
# File lib/xtemplate/xml.rb, line 379
def to_s()
  @node.to_s()
end
to_yaml() click to toggle source
# File lib/xtemplate/yaml.rb, line 14
def to_yaml
  @node.to_yaml
end