Skip to content
Rexle is an XML parser intended for quickly returning elements from an XPath query.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
MIT-LICENSE
README.md
gem-public_cert.pem
rexle.gemspec
test_rexle.rb
testdata.xml

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

Something went wrong with that request. Please try again.