<div dir="ltr"><a href="https://www.web3d.org/specifications/java/X3DJSAIL.html">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>