<div dir="auto">This may be a more up to date JsonLoaderTest.java attached.</div><div dir="auto"><br></div><div dir="auto">Please figure out how to include it in your tests.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">John Carlson</strong> <span dir="auto"><<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>></span><br>Date: Sun, Jun 20, 2021 at 12:23 AM<br>Subject: Differences between input JSON and output JSON<br>To: Don Brutzman <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>>, X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br></div><br><br>Java with ConfigurationProperties set is attached.  The code works, <br>
except for 1) X3DLoaderDOM or 2) the toFileJSON/XML output.<br>
<br>
I can't compare with test code Java output because currently Java is not <br>
output in Don's X3DJSAIL test.  It looks like the XML pretty printer is <br>
at fault, which might mean the scenegraph is wrong.   For example, <br>
search for Proto1 and Proto3<br>
<br>
I think evidence is weighing towards the issue where X3DJSONLD DOM <br>
output is good, looking at LoadedJsonConversion.xml<br>
<br>
So the evidence indicates that the following code may have issues:<br>
<br>
                         X3DLoaderDOM  xmlLoader = new X3DLoaderDOM();<br>
<br>
                         X3D X3D0 = <br>
(X3D)xmlLoader.toX3dModelInstance(document);<br>
X3D0.toFileX3D("examples/JsonLoaderTest.x3d");<br>
X3D0.toFileJSON("examples/JsonLoaderTest.json");<br>
<br>
<br>
If you run JsonLoaderTest.java attached, you will see numerous log <br>
messages.  Place the java file in <br>
www_web3d_org/x3d/stylesheets/java/tests/org/web3d/x3d/tests and run in <br>
NetBeans.   Add the full X3DJSAIL jar to your path.<br>
<br>
<br>
So we have a Java X3DJSONLD.java that seems to work, at least it gets <br>
good XML after the JSON is converted to DOM.<br>
<br>
<br>
HWPO.json is original<br>
<br>
JLT.json is the output<br>
<br>
Both files have been formatted with jsonlint.<br>
<br>
$ diff -w HWPO.json JLT.json<br>
166a167,178<br>
 >         },<br>
 >         {<br>
 >           "@name": "translated",<br>
 >           "@content": "19 June 2021"<br>
 >         },<br>
 >         {<br>
 >           "@name": "generator",<br>
 >           "@content": "X3dToJson.xslt, <br>
<a href="https://www.web3d.org/x3d/stylesheets/X3dToJson.html" rel="noreferrer" target="_blank">https://www.web3d.org/x3d/stylesheets/X3dToJson.html</a>"<br>
 >         },<br>
 >         {<br>
 >           "@name": "reference",<br>
 >           "@content": "X3D JSON encoding: <br>
<a href="https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding" rel="noreferrer" target="_blank">https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding</a>"<br>
1308,1319d1319<br>
<                 "ProtoInstance": {<br>
<                   "@name": "NewWorldInfo",<br>
<                   "@DEF": "Proto1",<br>
<                   "fieldValue": [<br>
<                     {<br>
<                       "@name": "description",<br>
<                       "@value": "testing 1 2 3"<br>
<                     }<br>
<                   ]<br>
<                 }<br>
<               },<br>
<               {<br>
1330,1335d1329<br>
<                 "ProtoInstance": {<br>
<                   "@name": "NewWorldInfo",<br>
<                   "@DEF": "Proto3"<br>
<                 }<br>
<               },<br>
<               {<br>
1451,1457c1445<br>
<                 "DISEntityManager": {<br>
<                   "-children": [<br>
<                     {<br>
<                       "DISEntityTypeMapping": {}<br>
<                     }<br>
<                   ]<br>
<                 }<br>
---<br>
 >                 "DISEntityManager": {}<br>
1481,1487c1469<br>
<           "DISEntityManager": {<br>
<             "-children": [<br>
<               {<br>
<                 "DISEntityTypeMapping": {}<br>
<               }<br>
<             ]<br>
<           }<br>
---<br>
 >           "DISEntityManager": {}<br>
1497,1543d1478<br>
<               },<br>
<               {<br>
<                 "Anchor": {<br>
<                   "@USE": "siteAnchor"<br>
<                 }<br>
<               },<br>
<               {<br>
<                 "Inline": {<br>
<                   "@USE": "inlineScene"<br>
<                 }<br>
<               },<br>
<               {<br>
<                 "DISEntityTypeMapping": {}<br>
<               },<br>
<               {<br>
<                 "GeoMetadata": {}<br>
<               },<br>
<               {<br>
<                 "AudioClip": {}<br>
<               },<br>
<               {<br>
<                 "ImageCubeMapTexture": {}<br>
<               },<br>
<               {<br>
<                 "ImageTexture3D": {}<br>
<               },<br>
<               {<br>
<                 "ImageTexture": {}<br>
<               },<br>
<               {<br>
<                 "MovieTexture": {}<br>
<               },<br>
<               {<br>
<                 "Script": {}<br>
<               },<br>
<               {<br>
<                 "PackagedShader": {}<br>
<               },<br>
<               {<br>
<                 "ShaderPart": {<br>
<                   "@type": "VERTEX"<br>
<                 }<br>
<               },<br>
<               {<br>
<                 "ShaderProgram": {<br>
<                   "@type": "VERTEX"<br>
<                 }<br>
<br>
</div></div>