[x3d-public] X3dToNodeJS.xslt, java/node/build.xml somewhat works

Don Brutzman brutzman at nps.edu
Mon Jun 1 22:26:13 PDT 2020


John, thanks for another excellent meeting today.

Can you please post the app.mjs example Node.js standalone program you were showing me today.  It is impressively terse and direct.  Link to your corresponding library as well please.  As discussed, I think it could be the basis for how do we make a simple X3D JavaScript library available for JavaScript programmers interested in a strongly typed X3D data structures, especially when running in Node.js.

It was further telling how your object API autogenerated implementation was landing on many of the same getter/setter patterns we've been using in Python x3d.py package.  Further there are direct similarities to the Java implementation in X3DJSAIL and the object encoding for JSON... essentially it looks like only the punctuation/bracket/assignment/parenthesis syntax is different for each.

I think it will be straightforward to tune the stylesheet to match X3D -> JavaScript in your form.  If we can do that, and they can be configured to run with Node.js to self validate, and we write this all up, then am willing to add conversions from .x3d -> .js with corresponding unit tests for publication with all models in the X3D Example Archives.

Not sure exactly how but a worthy goal is to examine whether addition of some utility methods to your API might further support common calls in X3D SAI for EcmaScript in Script node.

Looking forward to further explorations, good luck with your continuing efforts.

On 6/1/2020 12:31 AM, John Carlson wrote:
> Okay,  I have a version of X3dToNodeJS.xslt that works on the test cases in www.web3d.org/x3d/stylesheets/java/node <http://www.web3d.org/x3d/stylesheets/java/node> (the ant build.xml script there, target test.node).  I have noticed some peculiarties that I will try to track down. I accomplished all of this by bringing over code from X3dToJava.xslt into X3dToNodeJS.xslt.  There's more work to do, but at least "Hello, World" seems to be working fairly well, at least half the time.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list