Skip to content

Commit

Permalink
Merge pull request #373 from ericsciple/master
Browse files Browse the repository at this point in the history
Builder with attributes example
  • Loading branch information
Leonidas-from-XIV authored Feb 22, 2018
2 parents 847e0c3 + 5b482b1 commit f8a4d69
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ default configuration, except for `attrkey`, `charkey` and `explicitArray` optio
you can redefine to your taste. Writing CDATA is supported via setting the `cdata`
option to `true`.

To specify attributes:
```javascript
var xml2js = require('xml2js');

var obj = {root: {$: {id: "my id"}, _: "my inner text"}};

var builder = new xml2js.Builder();
var xml = builder.buildObject(obj);
```

Processing attribute, tag names and values
------------------------------------------

Expand Down

0 comments on commit f8a4d69

Please sign in to comment.