[xquery-talk] JSON query processing

David Lee dlee at calldei.com
Sat Oct 15 05:25:33 PDT 2011


I discussed mixed content briefly but alas not to mine or anyone's satisfaction.
JSON simply doesn't model it cleanly so any translation of XML mixed content to JSON which preserves the structure is inherently ugly.  But OTOH the 'natural' way for JSON to do mixed content does map well to the eventual object structure.

<p>This is <b>Bold</b></p>   

{"p" : [ "This Is " , { "b" : "Bold" } ] }


In practice what I've seen is people embedding yet another markup within JSON.
Where I work it is common to use HTML.  Because the JSON is really just a bit of meta data describing HTML in these apps.  So it would be

{ "content" : "<p>This is <b>Bold</b></p>" }

this is obviously preferable to simply sending XML or HTML in the first place  (don't ask ... :P)




 

----------------------------------------
David A. Lee
dlee at calldei.com
http://www.xmlsh.org

-----Original Message-----
From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Adam Retter
Sent: Saturday, October 15, 2011 5:53 AM
To: David Lee
Cc: xquery-discuss Talk; Francis Upton
Subject: Re: [xquery-talk] JSON query processing

> While my presentation balisage this year was on this topic exactly - how to
> get JSON and XML to be nice friends ...
>
> http://www.balisage.net/Proceedings/vol7/html/Lee01/BalisageVol7-Lee01.html

Very interesting!
Did you address the issue of XML with mixed content typically found in
more document based approaches, e.g. <p>hello <b>world</b> its a nice
day</p>, I scanned the paper but not come across an example. I may
have missed something?

> I am somewhat concerned about "Fixing" JSON by adding things XML has (like
> XSD, XSLT etc ...)
>
> by the time we add everything to JSON to make as useful as XML it will be as
> complicated as XML,
>
> and then we'll be having discussions about "Micro JSON".

Indeed.

>
>
>
>
>
>
> ----------------------------------------
>
> David A. Lee
>
> dlee at calldei.com
>
> http://www.xmlsh.org
>
>
>
> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf
> Of Francis Upton
> Sent: Friday, October 14, 2011 6:10 PM
> To: xquery-discuss Talk
> Subject: Re: [xquery-talk] JSON query processing
>
>
>
> P.S. the first one who has the courage to say that XML and JSON should
> co-exist
> non only peacefully, but in close harmony, has all my respects. (I think so,
>  but I didn't dare to  say it publicly  :-)
>
> I will say it. I think JSON is a nice syntax and can be more compact and
> readable than XML. Last I looked (which was a while ago), they did not have
> any standard means of specification (like XSD), so that needs to be fixed.
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
>
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
>



-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

_______________________________________________
talk at x-query.com
http://x-query.com/mailman/listinfo/talk




More information about the talk mailing list