Skip to content

Commit 0641b7b

Browse files
committed
Added example for object conversion
1 parent 83a31ce commit 0641b7b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ will result in:
3636
</root>
3737
```
3838

39+
It is also possible to convert objects into nodes:
40+
41+
``` js
42+
builder.create({
43+
root: {
44+
xmlbuilder: {
45+
'@for': 'node-js', // attributes start with @
46+
repo: {
47+
'@type': 'git',
48+
'#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // #text denotes element text
49+
}
50+
}
51+
}
52+
});
53+
```
54+
3955
If you need to do some processing:
4056

4157
``` js

0 commit comments

Comments
 (0)