pkeenatkongregate / eggnog

Eggnog is an optimized XML parser written in Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Eggnog

travis

A fast XML and JSON parser.

Installation

  gem install eggnog

Usage

XML

Easily parse the following XML:

  xml =<<DOC
  <?xml version="1.0"?>
  <foo>
    <bar baz="boo">Some text value</foo>
  </foo>
  DOC

like this:

Eggnog::XML.parse(xml)

which returns:

  {
    "foo" => {
      "bar" => "Some text value"
    }
  }

Additional Options

Preserve XML attributes:

  Eggnog::XML.parse(xml, :preserve_attributes => true)

returns:

  { 
    "foo" => {
      "bar" => { 
        "__content__" => "Some text value", 
        "baz" => "boo" 
      } 
    } 
  }

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Eggnog is an optimized XML parser written in Ruby

License:MIT License


Languages

Language:Ruby 100.0%