<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>John,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Thanks for the processing summary.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>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?<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>All the best,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Roy<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> yottzumm@gmail.com [mailto:yottzumm@gmail.com] <br><b>Sent:</b> 23 February 2017 04:17<br><b>To:</b> Roy Walmsley <roy.walmsley@ntlworld.com>; 'X3D Graphics public mailing list' <x3d-public@web3d.org>; Don Brutzman <brutzman@nps.edu><br><b>Subject:</b> RE: How should CAD -shape containerField be expressed in X3DJSAIL<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Here’s the workflow:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>X3D XML ->  X3dToJson.xslt (perhaps via RunSaxon.java) ->  Correct JSON<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Correct JSON -> runjson.sh -> json2all.js -> convertJSON.js -> X3DJSON.js (produces XML DOM) -> JavaSerializer.js -> Java<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Java -> javac -> java -> X3DJSAIL (outputs XML to intermediate file calls X3dToJson.xslt—my understanding) -> Incorrect JSON<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>diff Correct JSON with Incorrect JSON to see differences with containerField.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Incorrect JSON -> Ajv + JSON Schema -> Errors.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I’ll leave it to Don to describe how X3DJSAIL is produced from XML Schema and the Object Model.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Don has this envisioned:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>X3D XML -> X3DJSAIL (Java Objects using reflection) ->  Many by style sheet.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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)!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>John<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From: </span></b><span lang=EN-US><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Sent: </b>Wednesday, February 22, 2017 7:08 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>; <a href="mailto:x3d-public@web3d.org">'X3D Graphics public mailing list'</a><br><b>Subject: </b>RE: How should CAD -shape containerField be expressed in X3DJSAIL<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>Thanks John.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>You are right, I don’t have a 3.1 schema for JSON.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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..<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sorry not to be more instantly helpful,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Roy<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> <a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a> [<a href="mailto:yottzumm@gmail.com">mailto:yottzumm@gmail.com</a>] <br><b>Sent:</b> 22 February 2017 23:12<br><b>To:</b> Roy Walmsley <<a href="mailto:roy.walmsley@ntlworld.com">roy.walmsley@ntlworld.com</a>>; X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br><b>Subject:</b> FW: How should CAD -shape containerField be expressed in X3DJSAIL<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>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?)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/%7battachments%7d">www.web3d.org/x3d/content/examples/Basic/CAD/{attachments}</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>John<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From: </span></b><span lang=EN-US><a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a><br><b>Sent: </b>Tuesday, February 21, 2017 1:38 AM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>How should CAD -shape containerField be expressed in X3DJSAIL<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>John<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>