Module: PoxPaginate::XmlMini::JDOM
- Defined in:
- lib/pox_paginate/xml_mini/jdom.rb
Instance Method Summary collapse
Instance Method Details
#root_node_attributes(xml) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pox_paginate/xml_mini/jdom.rb', line 13 def root_node_attributes(xml) dbf = DocumentBuilderFactory.new_instance xml_string_reader = StringReader.new(xml) xml_input_source = InputSource.new(xml_string_reader) doc = dbf.new_document_builder.parse(xml_input_source) attribute_hash = {} attributes = doc.document_element.attributes for i in 0...attributes.length attribute_hash[attributes.item(i).name] = attributes.item(i).value end attribute_hash end |