Sha256: ec47a4da4d979faa247ebf01cd8c299979383ef59a37b57550f3c392dcf2a192
Contents?: true
Size: 990 Bytes
Versions: 1
Compression:
Stored size: 990 Bytes
Contents
module LibXMLJRuby module XML class Document class << self def file(filename) XML::Parser.file(filename).parse end def from_java(java_obj) d = new d.java_obj = java_obj d end end attr_accessor :java_obj # org.w3c.dom.Document def initialize(xml_version = 1.0) @xml_version = xml_version @xpath_cache = {} end def validate(dtd) dtd.validate(self) end def find(expr, nslist = nil) @xpath_cache[[expr, nslist]] ||= XML::XPath::Object.new(expr, self, nslist) end def find_first(expr, nslist = nil) find(expr, nslist).first end def child? java_obj.hasChildNodes end def parent? !!java_obj.parent_node end def root @root ||= Node.from_java(java_obj.document_element) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
libxml-jruby-modified-1.0.1-jruby | lib/libxml-jruby/xml/document.rb |