Rexle is an XML parser intended for quickly returning elements from an XPath query.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
MIT-LICENSE updated the gemspec to include the MIT license, homepage and email at… Jul 27, 2013
README.md
gem-public_cert.pem minor feature: the name of an attribute can now be passed into Rexle:… Mar 28, 2016
rexle.gemspec improvement: An input rexle array can now have an empty array for chi… Feb 25, 2017
test_rexle.rb
testdata.xml updated the tests with a very basic xml example Feb 4, 2011

README.md

Introducing the Rexle gem

require 'rexle'

s = "<a>ddd<trust colour='red'>abc</trust><ccc>rrr</ccc></a>"
doc = Rexle.new s
r = doc.root.xpath 'trust'
r.first.value
#=> abc

r.first.attributes
#=> {"colour"=>"red"}

s = "<a>ddd<trust>abc</trust><ccc>rrr</ccc></a>"
Rexle.new(s).root.element('trust').value
#=> abc

s = "<a>ddd<trust>abc</trust><ccc><eee>fff</eee></ccc></a>"
Rexle.new(s).root.element('ccc/eee').value
#=> "fff"

Rexle is an XML parser intended for returning elements from an XPath query faster than REXML, and Nokogiri.

Resources