XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] YPath, ZPath?

> 
> I was sorry to read that XQuery 3.1 is not considering JSON data as a tree: JSON is treated as a "complex" atomic type, from my point of view.
> 

You can regard the output of parse-json() as a tree (of maps, arrays, etc), but it is different from the tree representation of XML. The main difference is that the maps, arrays, etc produced by parse-json() have no parent.

This corresponds closely to the way JSON data is handled in other programming languages.

This apparently trivial difference has some interesting and profound consequences. Transformations of a tree in which many branches of the tree remain unchanged become much more efficient, because (in an environment where in-situ update is not allowed) copying a subtree has zero cost. However, the lack of upwards or sideways navigation means that during a recursive descent of the tree, you need to pass a lot more context.

For an exploration of the effect of these differences on some transformation use cases, see my XML Prague 2016 paper.

Michael Kay
Saxonica




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS