- Source
- Commits
- Network (2)
- Issues (3)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Oct 11 01:41:21 -0700 2010 | |
| |
.rspec | Fri Oct 15 11:42:49 -0700 2010 | |
| |
Gemfile | Tue Oct 12 07:49:06 -0700 2010 | |
| |
Gemfile.lock | Mon Oct 18 17:42:35 -0700 2010 | |
| |
LICENSE | Sat Oct 02 22:18:57 -0700 2010 | |
| |
README.rdoc | Tue Oct 12 08:09:36 -0700 2010 | |
| |
Rakefile | Mon Oct 11 12:59:46 -0700 2010 | |
| |
lib/ | Mon Oct 18 17:42:35 -0700 2010 | |
| |
multi_xml.gemspec | Tue Oct 12 08:09:36 -0700 2010 | |
| |
spec/ | Mon Oct 18 17:40:36 -0700 2010 |
README.rdoc
MultiXML
A generic swappable back-end for XML parsing
Lots of Ruby libraries utilize XML parsing in some form, and everyone has their favorite XML library. In order to best support multiple XML parsers and libraries, multi_xml is a general-purpose swappable XML backend library. You use it like so:
require 'multi_xml'
MultiXml.parser = :nokogiri
MultiXml.parse('<tag>This is the contents</tag>') # parsed using Nokogiri
MultiXml.parser = :rexml
MultiXml.parser = MultiJson::Parser::Rexml # equivalent to previous line
MultiXml.parse('<tag>This is the contents</tag>') # parsed using REXML
The parser setter takes either a symbol or a class (to allow for custom XML parsers) that responds to .parse at the class level.
MultiXML tries to have intelligent defaulting. That is, if you have any of the supported parsers already loaded, it will utilize them before attempting to load any. When loading, libraries are ordered by speed. First LibXML, then Nokogiri, then REXML.
Inspiration
MultiXML was inspired by MultiJSON.
Submitting Patches
- Fork the project.
- Commit your feature or bug fix.
- Add tests for it. This is important so it doesn’t break in the future.
- Do not mess with gemspec, version, or history. (If you want to have your own version, that’s fine, but please do so in a separate commit.)
- Submit a pull request. Bonus points for topic branches.
Copyright
Copyright © 2010 Erik Michaels-Ober. See LICENSE for details.

