[x3d-public] second round of X3D JSON conversion support using X3dToJson.xslt

Leonard Daly web3d at realism.com
Mon Mar 9 11:25:28 PDT 2015


Don and others,

This is great work in advance of the call. I have been mostly staying 
out of the discussion, but actively reading the messages.

I've trimmed Don's latest post to get to a couple of questions I have.



>
>
> Completely converted HelloWorld.json attached.  Looks like a pair of 
> slightly different design patterns (first for header and then for 
> scene graph) are required and holding together OK so far. Still passes 
> jslint in its strictest mode.  http://www.jslint.com
...
>
> =======================================================================
> 7. Apparently not possible or not needed.
>
> - Embedded JSON comments are specifically disallowed by JSON 
> specification
>   and so round-trippable inclusion must be a custom feature of this 
> encoding.
> http://www.quora.com/How-do-I-write-comments-inside-a-JSON-document
> - No JSON-unique header. Can optionally use X3D/head/meta name=value 
> pairs
>   (if capturing full document) or comments in a scene-graph fragment
>   or even an X3D Metadata node.  However for anything intended to be
>   interoperable/reusable, consistency and repeatability is needed.
>   Leaving the output JSON as simple as possible avoids code problems and
>   provides programmers with the greatest possible flexibility. Further
>   analysis will show if a JSON header is needed, probably a non-problem.
> - DOCTYPE information is dropped.  This is commonplace for XSLT and does
>   not appear to be needed in the JSON encoding.  If actually needed by 
> someone,
>   such information can be reconstructed simply by using the X3D 
> version number.
> http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Validation

Many languages (including PHP and Perl, I also presume Python, and 
perhaps JavaScript) have libraries that will do a JSON -> XML 
conversion. After conversion it would be necessary to write code to 
convert the JSON embedded comments to true XML comments. Using one of 
these may save some development time and effort.


Is it possible to construct an extremely simple X3D scene (or scene-let) 
that illustrates the issues with the various possible JSON encodings? 
This would not be a test scene, but something that is short (<20 lines) 
and has sufficient structure to illustrate why certain encodings work or 
do not work.

The attachment to the previous message is good as a test case, but is 
long to easily grasp the issues. Perhaps multiple discussion scenes are 
needed to address the various issues - something to discuss the headers 
(but an empty scene), something to show node array issues, something to 
use for ROUTE/IS/PROTOs, etc.


-- 
*Leonard Daly*
X3D Co-Chair
Cloud Consultant
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150309/72e967b4/attachment-0001.html>


More information about the x3d-public mailing list