File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 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
1715Here's a working example for the purchase order schema.
1816
19- 1 . Generate mappings
17+ ### Generate mappings
2018
2119```
2220java -jar jsonix-full.jar -d mappings -p PO purchaseorder.xsd
2321```
2422
2523Generates 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 `` .
You can’t perform that action at this time.
0 commit comments