~zorba-coders/zorba/bug-1188035-csv

« back to all changes in this revision

Viewing changes to test_json/Queries/converters/jansson/parse_json_10.xq

  • Committer: Tarmac
  • Author(s): Paul J. Lucas
  • Date: 2012-01-24 01:56:27 UTC
  • mfrom: (79.1.1 data-converters-module)
  • Revision ID: tarmac-20120124015627-v8to61s7w8of53m6
Removed old JSON module. Approved: Matthias Brantner, Paul J. Lucas

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";
2
 
import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options";
3
 
 
4
 
json:parse('[{
5
 
     "firstName": "John",
6
 
     "lastName": "Smith",
7
 
     "address": {
8
 
         "streetAddress": "21 2nd Street",
9
 
         "city": "New York",
10
 
         "state": "NY",
11
 
         "postalCode": 10021
12
 
     },
13
 
     "phoneNumbers": [
14
 
         "212 732-1234",
15
 
         "646 123-4567"
16
 
     ]
17
 
 },
18
 
{
19
 
   "firstName": "John",
20
 
   "state": null,
21
 
   "bool": true ,
22
 
   "numbers": [1,2,3] ,
23
 
   "address": {
24
 
       "streetAddress": "21 2nd Street",
25
 
       "state": null,
26
 
       "postalCode": 10021 ,
27
 
       "literals": [true,false,null],
28
 
       "delivery": {
29
 
                "streetAddress": "StreetName",
30
 
                "city": "CityName",
31
 
                "state": "StateName"
32
 
        }} ,
33
 
   "strings": [
34
 
       "one",
35
 
       "two",
36
 
       "three",
37
 
       "four" ]
38
 
}]',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
39
 
              <json-param name="mapping" value="simple-json" />
40
 
            </options>)