Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rexle is an XML parser intended for quickly returning elements from an XPath query.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 gem-public_cert.pem
Octocat-spinner-32 rexle.gemspec
Octocat-spinner-32 test_rexle.rb
Octocat-spinner-32 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.