Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yegor256/xembly.rb

A command line tool for XML manipulations in Xembly, an imperative DSL
https://github.com/yegor256/xembly.rb

ruby ruby-gem xml xml-document

Last synced: 4 months ago
JSON representation

A command line tool for XML manipulations in Xembly, an imperative DSL

Awesome Lists containing this project

README

        

[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/xembly.rb)](http://www.rultor.com/p/yegor256/xembly.rb)
[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)

[![Gem Version](https://badge.fury.io/rb/xembly.svg)](http://badge.fury.io/rb/xembly)
[![Maintainability](https://api.codeclimate.com/v1/badges/f26349e81b04628d8bf7/maintainability)](https://codeclimate.com/github/yegor256/xembly.rb/maintainability)
[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/xembly.rb.svg)](https://codecov.io/github/yegor256/xembly.rb?branch=master)

Xembly is assembly for XML.

Read this [blog post](http://www.yegor256.com/2014/04/09/xembly-intro.html)
and check this project: [yegor256/xembly](https://github.com/yegor256/xembly)

To install, you will need Ruby 2.0+:

```bash
$ gem install xembly
```

Then, run it and read its output:

```bash
$ xembly --help
```

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

```xml

Object Thinking
Elegant Objects

```

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

```
$ xembly --xml doc.xml 'XPATH "/books"; ADD "book"; ATTR "isbn", "0201379430"; SET "Object Design";'

Object Thinking
Elegant Objects
Object Design

```

Simple as that!

The full specification of Xembly language is
[here](https://github.com/yegor256/xembly).