<div dir="ltr">This is a long, but good read.<div><br></div><div>Indeed, here is a copy of the Java version of the JavaScript previously sent.  If someone can take over this whole JSON -> DOM/XML conversion process in Java (including net/coderextreme/X3DJSONLD.java--perhaps incorporate it into the X3DJSAIL generation process, or a utils folder), it would be appreciated, so I can keep primary focus on Node.js, ES6+, JSON, and Nashorn.<div><br><div><a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/net/coderextreme/JsonConversion.java">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/net/coderextreme/JsonConversion.java</a><br></div><div><br></div><div>If someone wants me to write a JSON -> X3DJSAIL converter instead of a JSON -> Document -> X3DJSAIL converter, let me know, maybe we can work something out...like you supporting creating the XSLT for XML -> ES6, and updating X3dToES5.xslt and X3dToNodeJS.xslt (yes I realize we don't want to run this on all the archives without careful appraisal. I suggest using non-.js filenames.  We could use .mjs (module-based ecmascript) as a possible extension for the ES6 archive files.</div><div><br></div><div>Perhaps it would be worth a meeting to introduce some features of ES6 (modules, import/export classes, setters, getters)?  I don't really have a firm grip on it yet, but I can point in a general direction, since I've got some working code (displays a cube in a Jupyter notebook.)  One important strange thing is, you have to be in a module to call a module.</div><div><br></div><div>I'd like to get a feel how important SAI is for X3DOM, and whether X3DOM users desire a standard SAI?  Also, people coming from the X3D browsers to web browsers...can they or do they want to use X_ITE instead of X3DOM?</div><div><br></div><div>Do we need two implementations of ECMAScript SAI to qualify it as a standard?  Would it be best to target what we have from X_ITE and the draft in our XSLT coding, or branch out in a new direction with ES6?</div><div><br></div><div>Could ES6 inform us how to implement the ProtoExpander better?  If we have a class environment, do we need a ProtoExpander environment?   Can we convert Prototypes to JavaScript instead of clinging to XML and JSON?</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 20, 2020 at 8:29 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">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" target="_blank">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>
</blockquote></div>