[x3d-public] How should CAD -shape containerField be expressed in X3DJSAIL
Roy Walmsley
roy.walmsley at ntlworld.com
Thu Feb 23 02:32:36 PST 2017
John,
Thanks for the processing summary.
The JSON file you attached to your previous message was incorrect. So, I take it that this file corresponds to the “Incorrect JSON” listed at the end of the third line below. In contrast, the JSON at the end of the first line is correct. This implies that the X3dToJson stylesheet transform works correctly.
So, the processing is going wrong somewhere on the second and third lines you listed. What can you tell from your intermediate results? For example, is the Java correct that you listed at the end of the second line?
All the best,
Roy
From: yottzumm at gmail.com [mailto:yottzumm at gmail.com]
Sent: 23 February 2017 04:17
To: Roy Walmsley <roy.walmsley at ntlworld.com>; 'X3D Graphics public mailing list' <x3d-public at web3d.org>; Don Brutzman <brutzman at nps.edu>
Subject: RE: How should CAD -shape containerField be expressed in X3DJSAIL
Here’s the workflow:
X3D XML -> X3dToJson.xslt (perhaps via RunSaxon.java) -> Correct JSON
Correct JSON -> runjson.sh -> json2all.js -> convertJSON.js -> X3DJSON.js (produces XML DOM) -> JavaSerializer.js -> Java
Java -> javac -> java -> X3DJSAIL (outputs XML to intermediate file calls X3dToJson.xslt—my understanding) -> Incorrect JSON
diff Correct JSON with Incorrect JSON to see differences with containerField.
Incorrect JSON -> Ajv + JSON Schema -> Errors.
I’ll leave it to Don to describe how X3DJSAIL is produced from XML Schema and the Object Model.
Don has this envisioned:
X3D XML -> X3DJSAIL (Java Objects using reflection) -> Many by style sheet.
I am producing intermediate results which may be inspected, like Java code, for testing purposes. My primary purpose with Java is to produced JSON code from JSON input for roundtrip testing. And possible to get a declarative Java encoding with modern Java 8 efficiencies (more on that later). And we are starting to be more successful with knocking out bugs again (see CompileJava.zip please)!
Actually Java source code is probably not the way to go because it doesn’t allow that many constants (numbers I think). There will be some limitations we may have to program around, or ask Oracle to extend. Really, VRML, XML and JSON are preferred in this case of encoding over the current state of Java—but reflection may work too.
John
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
Sent: Wednesday, February 22, 2017 7:08 PM
To: yottzumm at gmail.com <mailto:yottzumm at gmail.com> ; 'X3D Graphics public mailing list' <mailto:x3d-public at web3d.org>
Subject: RE: How should CAD -shape containerField be expressed in X3DJSAIL
Thanks John.
You are right, I don’t have a 3.1 schema for JSON.
I manually inspected the examples. They seem fine to me, and the JSON validates against the V3.3 JSON schema. This can only mean that I don’t understand your problem. To my eyes, all the examples and schemas are fine. So to clarify, please give me a step-by-step account of what you are doing. What are you starting from? What tools to you use to do what with it? Etc..
Sorry not to be more instantly helpful,
Roy
From: yottzumm at gmail.com <mailto:yottzumm at gmail.com> [mailto:yottzumm at gmail.com]
Sent: 22 February 2017 23:12
To: Roy Walmsley <roy.walmsley at ntlworld.com <mailto:roy.walmsley at ntlworld.com> >; X3D Graphics public mailing list <x3d-public at web3d.org <mailto:x3d-public at web3d.org> >
Subject: FW: How should CAD -shape containerField be expressed in X3DJSAIL
Here are the examples I am referring to. The ones with the shape container that supposedly are supposed to validate properly. However, there is some comments in the meta stuff that you may want to check:. I hope I am not chasing a red herring again. I don’t see how you could validate it against the JSON schema, unless you have a 3.1 schema. (can I have a copy?)
www.web3d.org/x3d/content/examples/Basic/CAD/{attachments} <http://www.web3d.org/x3d/content/examples/Basic/CAD/%7battachments%7d>
John
Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: yottzumm at gmail.com <mailto:yottzumm at gmail.com>
Sent: Tuesday, February 21, 2017 1:38 AM
To: Don Brutzman <mailto:brutzman at nps.edu> ; Roy Walmsley <mailto:roy.walmsley at ntlworld.com> ; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
Subject: How should CAD -shape containerField be expressed in X3DJSAIL
Attached input JSON and converted Java. The Java does not produce -shape in the output JSON.json file [ not provided—compile and run the Java ]. Is this OK? I am currently using setShape in the Java. Why doesn’t the JSON.json have the containerField? Thanks!
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170223/b0a014d9/attachment-0001.html>
More information about the x3d-public
mailing list