<div dir="auto">I think I’ve found this before: </div><div dir="auto"><br><div dir="auto"><a href="https://openusd.org/dev/api/js_page_front.html">https://openusd.org/dev/api/js_page_front.html</a></div><div dir="auto"><br></div><div dir="auto">JSON I/O for USD</div><div dir="auto"><br></div><div dir="auto">John</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 20, 2023 at 11:41 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-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">I am taking out my JavaScript calling Java and Python calling Java, even though there are new versions of the npm java module and pyjnius.  Don called it right on that.  I am retaining Java code related to running stylesheets from bash.</div><div dir="auto"><br></div><div dir="auto">My current stumbling block in JSON validation is that webpack/babel blocks out the browser window variable.  I’m a bit lost there, but I need to do more searches.   Another case of, “If it ain’t broke, don’t fix it.”</div><div dir="auto"><br></div><div dir="auto">The good news is, JSONParser.js (X3DJSONLD.js) still seems to be working for X3DOM and X_ITE still seem to be working declaratively.  I’m not sure of the X3DOM JSON Prototype expander though.</div><div dir="auto">JSON validation another way might be in the works (or accomplished), but that doesn’t impact X3DOM or X_ITE that i know of, and we continue to wait on JSON schema while glTF runs towards the goal, which is fine.  You won’t find me coding by hand in glTF—that’s a separate market.  More likely I will be looking towards a USD/JSON solution for the metaverse.  Mojo promises to raise the level of abstraction for shaders to Python, so that’s way cool.  I don’t even really code JSON by hand either, mostly if i want to change something, I’ll go for the XML version.</div><div dir="auto"><br></div><div dir="auto">Is there any news on Script nodes for X3DOM?</div><div dir="auto"><br></div><div dir="auto">Expect to see an update to pythonSAI minus X3DJSAIL down the road.  I have adopted x3d.py, and will continue to develop the flat python serializer for Mojo.</div><div dir="auto"><br></div><div dir="auto">Converting JSON encoding to Python SAI and HAnim scaling of geometry are hot topics right now for me.  As far as I know, x3d.py doesn’t have any encoding import defs, instead X3dToPython.xslt is used AFAIK, with great success.</div><div dir="auto"><br></div><div dir="auto">It would seem that there are opportunities for iOS X3D.</div><div dir="auto"><br></div><div dir="auto">I have mostly handled the transition from #sourceText to #sourceCode in my python serializer.  I just need to run some tests converting back to XML and comparing.</div><div dir="auto"><br></div><div dir="auto">I’ll be looking for some USD examples if someone has them.  Does anyone want a VRML version of USD?</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 20, 2023 at 12:19 PM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal">Hi John.  Small update:  latest build is using Saxon 12.1, as shown in<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><ul style="margin-top:0in" type="disc"><li style="margin-left:0in">(last release)<a href="https://www.web3d.org/x3d/stylesheets/python/build.xml" target="_blank">https://www.web3d.org/x3d/stylesheets/python/build.xml</a> <u></u><u></u></li><li style="margin-left:0in">(latest dev)   <a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/build.xml" target="_blank">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/build.xml</a><u></u><u></u></li><li style="margin-left:0in"><property name="saxon.dir" location="../java/lib" description="relative path via stylesheets directory"/><u></u><u></u></li><li style="margin-left:0in"><property name="saxon.jar"           value="saxon-he-12.1.jar"/><u></u><u></u></li><li style="margin-left:0in"><!-- previously saxon-he-11.4.jar saxon-he-11.3.jar saxon-he-10.6.jar saxon9he.jar --><u></u><u></u></li></ul><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I only use the saxon-he “Home Edition” xslt engines because they are open source and quite stable.  Tested version is included in our sourceforge build so that you don’t have to hunt around to get things to work.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Previous versions like 10.6  that you report using might still work, but am not locking our XSLT stylesheets into any single version, always trying to stay compliant for long-term reliability.  Further note that the saxon-he distribution has a dependency on three .jar files that are shipped with it (no longer internal) and so they have to be handled properly as well.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">And looking online, Michael Kay and saxon team now have a version 12.2 and so will soon upgrade from 12.1 and test across multiple X3D projects/stylesheets.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><ul style="margin-top:0in" type="disc"><li style="margin-left:0in"><a href="https://github.com/Saxonica/Saxon-HE/tree/main/12/Java" target="_blank">https://github.com/Saxonica/Saxon-HE/tree/main/12/Java</a><u></u><u></u></li></ul><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Recommendation: saxon xslt3 is untested and not a part of our current XSLT version 2 stylesheet development.  Use at your own risk, experience has shown that changing XSLT versions can be a major upgrade and change.  Since we don’t need any XSLT3 functionality currently, with a long TODO list getting whittled down, that change won’t happen for X3D4 stylesheets anytime soon.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Have fun with stable X3D!  8) <u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New""><u style="font-family:"Courier New""></u> <u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">all the best, Don<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">-- <u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Don Brutzman  Naval Postgraduate School, Code USW/Br        <a href="mailto:brutzman@nps.edu" style="font-family:"Courier New"" target="_blank">brutzman@nps.edu</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">X3D graphics, virtual worlds, navy robotics <a href="https://faculty.nps.edu/brutzman" style="font-family:"Courier New"" target="_blank">https://faculty.nps.edu/brutzman</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p></div></div></div><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><u></u> <u></u></p><div><div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-color:rgb(225,225,225) currentcolor currentcolor"><p class="MsoNormal"><b>From:</b> John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> <br><b>Sent:</b> Tuesday, June 20, 2023 2:36 AM<br><b>To:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>>; Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br><b>Subject:</b> problems with Saxon's xslt3 node module<u></u><u></u></p></div></div><div><div><div><div><div><p class="MsoNormal"><span style="font-size:10pt"><u></u> <u></u></span></p><p class="MsoNormal">Saxon's xslt3 node.js module has serious issues using X3dToJson.xslt.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">For example, an entire ProtoInstance was deleted when converting to abox.x3d to JSON.  (see attached abox.3d)<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Fortunately, their Java Saxon 10.6 HE is our primary stylesheet processor and is working well.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Here is some pseudocode for running xslt3. You will need some way to install xslt3, like npm (part of node.js package).<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">$ npm install -g xslt3<u></u><u></u></p></div><div><p class="MsoNormal">$ xslt3 -xsl:X3dToJson.xslt -s:abox.x3d -o:abox.json<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Hmm!<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">John<u></u><u></u></p></div></div></div></div></div></div></div></div></blockquote></div></div>
</blockquote></div></div>