<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 24, 2020 at 8:20 AM Don Brutzman wrote:</div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Authoring use-case environments are<br>
1. Script inside X3D scene graph,<br>
2. Script in outer HTML5 web page,<br>
3. Standalone programmatic use in node.js<br>
<br>
Now get specific.<br></blockquote><div><br></div><div>Not yet.   We need to discuss the environments.   X_ITE does inside X3D, and with the addition of X_ITE_DOM, in outer HTML5. X3DOM does outer HTML5. X3DJSAIL is a standalone library.</div><div><br></div><div>So what we really need is a standalone EAI for node.js without rendering except to an encoding.  Can we turn either X3DJSAIL, X_ITE or X3DOM into such an environment?  I provided a solution for Nashorn on top of X3DJSAIL, but not a solution for node.js. Have we had any take up on the Nashorn solution, enough to warrant a node.js solution?</div><div><br></div><div>So I would recommend that before researching all the various Transforms, that we just try to develop a single Transform.js class for node.js, with an encoding rendering.  It will be throwaway code, just a proof of concept.</div><div><br></div><div>Suggestions for next steps are welcome, and I will review Don's email again and see what he said.</div><div><br></div><div>For node.js, I believe there are packages that emulate the browser enviroment, i think that jsdom (?) and xmldom are two popular ones, so we can look at turning node.js into a headless browser.   There are also ways to run browsers in headless mode, PhantomJs comes to mind, but I haven't researched this extensively.</div><div><br></div><div>There are environments for running Java and node.js together, as I demonstrated with RunSaxon.java in X3DJSONLD.  My approach for that was simplistic, and won't really work for a multiclass approach.  There is also the java npm package that may lead towards a solution.</div><div><br></div><div>So a possible path forward is generating the glue code between node.js and Java, similar to what we did for PyJNIus.</div><div><br></div><div>I suggest that we do a very simple single class solution, not unlike the RunSaxon.java solution. This required various node.js files.   I think the new solution will be more complex to deal with the npm java peculiarities.</div><div><br></div><div>So this is throwaway code for now, just a single class.</div><div><br></div><div>Note that I have been stripping RunSaxon code out of my code, since I have a XML to JSON solution.</div><div><br></div><div>What do you think?</div><div><br></div><div>John</div><div><br></div></div></div>