Made By Teamed.io DevOps By Rultor.com We recommend RubyMine

Build Status Build status Gem Version Dependency Status Code Climate Coverage Status

Assembly for XML

Read this blog post and check this project: yegor256/xembly

How to Install?

You will need Ruby 2.0+:

$ gem install xembly

How to Run?

Run it locally and read its output:

$ xembly --help

Say, you want to modify an existing XML document, which is in file doc.xml:

<books>
  <book isbn="0735619654">Object Thinking</book>
  <book isbn="1519166915">Elegant Objects</book>
</books>

Now, say, you want to add one more book there:

$ xembly --xml doc.xml 'XPATH "/books"; ADD "book"; ATTR "isbn", "0201379430"; SET "Object Design";'
<books>
  <book isbn="0735619654">Object Thinking</book>
  <book isbn="1519166915">Elegant Objects</book>
  <book isbn="0201379430">Object Design</book>
</books>

Simple as that!

Full specification of Xembly language is here.