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

« back to all changes in this revision

Viewing changes to test_json/Queries/converters/jansson/serialize_json_01.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
 
 
5
 
declare variable $tmp := <json type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></json>;
6
 
 
7
 
json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
8
 
              <json-param name="mapping" value="simple-json" type="array"/>
9
 
            </options>)
 
 
b'\\ No newline at end of file'