<div dir="ltr">Note that that this feature is built entirely from the X3D sourceforge repository, that is, it's provided independent of X3DJSONLD (note that the main class is titled X3DJSONLD.java -- it's a pure java port of X3DJSONLD.js, and any shared code between X3DJSAIL and X3DJSONLD is for backup or testing reasons.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 20, 2020 at 8:21 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">https://www.web3d.org/specifications/java/X3DJSAIL.html</a><br><div><br></div><div>say .json import/file load is TODO.</div><div><br></div><div>Here is a sample Node.js file which shows the feature, and the Nashorn has a similar example.</div><div><br></div><div>var java = require('java');<br>var autoclass = require ('./X3Dautoclass');<br>var X3DJSONLD = java.import("net.coderextreme.X3DJSONLD")<br>var loader = new X3DJSONLD();<br>var File = java.import("java.io.File")<br>var jsobj = loader.readJsonFileSync(new File("./examples/HelloWorldProgramOutput.json"));<br>var document = loader.loadJsonIntoDocumentSync(jsobj);<br>console.log(loader.serializeDOMSync(loader.getX3DVersionSync(jsobj), document));<br>var X3DLoaderDOM = java.import("org.web3d.x3d.jsail.X3DLoaderDOM")<br>var xmlLoader = new X3DLoaderDOM();<br>var X3D0 = xmlLoader.toX3dObjectTreeSync(document);<br>X3D0.toFileX3DSync("./examples/Json.x3d");<br>X3D0.toFileJSONSync("./examples/Json.json");<br></div><div><br></div><div><br></div><div>Note that this is easily converted to Java.  I've done it once, in fact.  All these pure Java functions (minus Sync) are available in Java code.</div><div><br></div><div>This leverages a port provided to X3DJSAIL which does the JSON -> DOM conversion in the X3DJSONLD.java class.</div><div><br></div><div>Might I suggest that browser vendors leverage X3DJSAIL jars and openjdk to support X3D JSON until a C/C++ version is complete?  Some lubrication ($$) is currently required to get a C/C++ version pushed out the door (I can't stand dealing with Xerces, CMake, autoconf), but last time I tried it, the alpha version worked.</div><div><br></div><div>John</div></div>
</blockquote></div>