https://github.com/threez/simple-xml
Some helpers for REXML::Element to create hashes from xml easily
https://github.com/threez/simple-xml
Last synced: about 1 year ago
JSON representation
Some helpers for REXML::Element to create hashes from xml easily
- Host: GitHub
- URL: https://github.com/threez/simple-xml
- Owner: threez
- Created: 2011-11-21T09:04:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-11-21T09:29:56.000Z (over 14 years ago)
- Last Synced: 2025-06-06T12:44:46.828Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SimpleXML
A simple add on to rexml to parse xml data simply by converting them to a hash.
That hash can than easily be passed to model objects to validate etc.
Example usage:
```ruby
doc = REXML::Document.new(%Q{
Deutschland
76135
Karlsruhe
Ernst-Frey-Str. 10
}
doc.simplify("/address") #=> { :country => "Deutschland", :zip_code => "76135", :city => "Karlsruhe", :street => { :name_and_number => "Ernst-Frey-Str. 10" } }
doc.simplify_attributes("/address/country") #=> { :iso_code => "de", :nationality => "deutsch" }
```