Last active
August 29, 2015 14:06
-
-
Save webdesignberlin/737ba1d561b385050a4b to your computer and use it in GitHub Desktop.
JSONx-Konvertierungsbeispiel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSONx conversion example | |
This topic introduces a JSONx conversion example. | |
The following example document is a sample of the JSON structure. | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"John Smith", | |
"address": { | |
"streetAddress": "21 2nd Street", | |
"city": "New York", | |
"state": "NY", | |
"postalCode": 10021, | |
}, | |
"phoneNumbers": [ | |
"212 555-1111", | |
"212 555-2222" | |
], | |
"additionalInfo": null, | |
"remote": false, | |
"height": 62.4, | |
"ficoScore": " > 640" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following output is the result of the transformed document as JSONx. | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<json:object xsi:schemaLocation="http://www.datapower.com/schemas/json jsonx.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:json="http://www.ibm.com/xmlns/prod/2009/jsonx"> | |
<json:string name="name">John Smith</json:string> | |
<json:object name="address"> | |
<json:string name="streetAddress">21 2nd Street</json:string> | |
<json:string name="city">New York</json:string> | |
<json:string name="state">NY</json:string> | |
<json:number name="postalCode">10021</json:number> | |
</json:object> | |
<json:array name="phoneNumbers"> | |
<json:string>212 555-1111</json:string> | |
<json:string>212 555-2222</json:string> | |
</json:array> | |
<json:null name="additionalInfo" /> | |
<json:boolean name="remote">false</json:boolean> | |
<json:number name="height">62.4</json:number> | |
<json:string name="ficoScore"> > 640</json:string> | |
</json:object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON identifiers are represented by the string contents in the name attribute. Most Unicode characters are valid within identifiers, as long as they are properly escaped (for example, \unnnn). Identifiers must not be European Computer Manufacturers Association (ECMA) reserved words. DataPower® appliances do not validate JSON property names beyond the JSON specification. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment