[x3d-public] Discussion. Order of component, unit and head in JSON encoding
John Carlson
yottzumm at gmail.com
Sat Feb 17 05:03:50 PST 2024
We’ll eventually get to this, I just want people to prepare. First off, I
have no complaints about X3dToJson.xslt, works great with X3DJSONLD.
Second, this message is about certain non-stylesheet peculiarities which
affect my website’s conversions to JSON and back to XML. I have recently
tested this on my X3DJSONLD website. Either X_ITE or X3DJSONLD needs be
fixed or replaced in order to get valid XML in round-trip conversions. I
have not had success with stylesheets on the web.
Primarily, should the order of component, unit and meta statements in X3D
JSON encoding matter? It doesn’t matter to JSON schema.
Where it does matter is when one converts JSON to a DOM document and then
validates with an XML schema.
Should the converter reorder the head statements in XML, or respect the
order in the JSON file? What should JSON generators do? How can we ensure
JSON generators are doing the right thing with head order without
converting to DOM documents?
It seems like I should modify X3DJSONLD to reorder the head statement
previously produced in JSON by Holger’s x3d-tidy/X_ITE, yet there is some
reluctance and I desire to reflect in JSON what XML looks like, and bomb
out on any JSON produced by x3d-tidy. I have no way of bombing out except
to convert to DOM and validate against XML schema.
Even if we fix the tools, should we specify order of statements in head in
the JSON encoding specification, and try to enforce with tools beyond JSON
schema?
Note that x3d-tidy is already set up to convert any JSON to appropriate
XML. I’ve tested this once. Perhaps it’s time to give up on X3DJSONLD.js
for JSON to XML conversions. This might mean giving up on JSON in X3DOM,
or leaving it up to X3DOM and future browser maintainers to deal with
x3d-tidy’s JSON output.
References:
https://www.web3d.org/x3d/stylesheets/X3dToJson.html
https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding
https://coderextreme.net/X3DJSONLD/src/main/html/index.html
Finally, I do batch conversions to convert XML to JSON with
X3dToJson.xslt. Would anyone like a batch converter based on Holger’s
x3d-tidy tool? Maybe something called x3d-batch?
Thanks!
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240217/51592d43/attachment.html>
More information about the x3d-public
mailing list