Skip to content

Commit d881979

Browse files
committed
Markdown.
1 parent f2c9ac9 commit d881979

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Jsonix
2-
======
1+
# Jsonix
32

43
* Jsonix (JSON interfaces for XML) is a JavaScript library which allows you to convert between XML and JSON structures.
54
* With Jsonix you can parse XML into JSON (this process is called _unmarshalling_) or serialize JSON in XML form (this is called _marshalling_).
@@ -11,20 +10,19 @@ Jsonix advantages:
1110
* Type-safe.
1211
* (Optionally) XML Schema-driven.
1312

14-
Example
15-
-------
13+
## Example
1614

1715
Here's a working example for the purchase order schema.
1816

19-
1. Generate mappings
17+
### Generate mappings
2018

2119
```
2220
java -jar jsonix-full.jar -d mappings -p PO purchaseorder.xsd
2321
```
2422

2523
Generates mappings for the `purchaseorder.xsd` schema in the `mappings\PO.js`; mappings will be placed in the variable `PO`.
2624

27-
2. Unmarshalling:
25+
### Unmarshalling:
2826

2927
```javascript
3028
// Include or require PO.js so that PO variable is available
@@ -46,8 +44,10 @@ unmarshaller.unmarshalURL('po.xml',
4644
console.log(unmarshalled.value.items.item[1].productName); // Baby Monitor
4745
});
4846
```
47+
48+
You can also ``unmarshalString``, ``unmarshalDocument`` and (under node.js) ``unmarshalFile``.
4949

50-
3. Marshalling
50+
### Marshalling
5151

5252
```javascript
5353
// Create a marshaller
@@ -73,4 +73,6 @@ var doc = marshaller.marshalDocument({
7373
items: { /* ... */ }
7474
}
7575
});
76-
```
76+
```
77+
78+
You can also ``marshalString``.

0 commit comments

Comments
 (0)