[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT functions for JSON

Subject: Re: XSLT functions for JSON
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Sun, 18 May 2008 10:04:26 -0400
Re:  XSLT functions for JSON
On Sun, 2008-05-18 at 15:52 +0200, Jesper Tverskov wrote:

> 
> 2. JSON has no way of handling even the most simple document oriented
> XML structure like: "h2, p, h2, p" if the order matters as is likely
> in the example. In JSON the order of the example will be changed to:
> "h2, h2, p, p".

You can use an array to set order. This is a place where I wish FXSL
would be more like the (reference?) implementation org.json's java
library where when an object  or array is encountered in the JSON, the
resulting XML is wrapped with 'o' and 'a' elements respectively.

> 
> 4. JSON has no standardized way of handling mixed content.
> Theoretically the most simple mixed content could be handled with a
> method similar to handling attributes but the prefix characters needed
> to tell text and element apart depends on who made the function. If
> mixed content consists of more than one text node and one element we
> run into the reordering problem.

Don't use JSON if you need to work with mixed content. It is not what is
made for.

Bottom line - there is no standardization. If you want to do xml2json
and json2xml you pick your library and write for it.

best,
-Rob

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.