Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rexle is an XML parser intended for quickly returning elements from an XPath query.
Ruby
branch: master

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.