<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>JSON – Java Script Object Notation – an alternative to XML “closer” to VRML.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Tuesday, February 19, 2019 1:25 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a>; <a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a>; <a href="mailto:iamhereintheworld@gmail.com">iam here</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: [x3d-public] Peripheral questions about X3D - developmentandbooks</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I handle JSON by converting JS to DOM after the JSON has been parsed (X3DJSONLD.js). I also have nashorn examples here:  <a href="https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/nashorn/net/coderextreme/data"><span style='color:#0563C1'>https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/nashorn/net/coderextreme/data</span></a>  and node.js examples here:  <a href="https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data"><span style='color:#0563C1'>https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data</span></a>  (requires java-npm library).  The JS APIs are written on top of X3DJSAIL (direct API map of functions to constructors):   <a href="http://www.web3d.org/specifications/java/X3DJSAIL.html"><span style='color:#0563C1'>http://www.web3d.org/specifications/java/X3DJSAIL.html</span></a> and thus, are server-side. I currently have no plans to write a pure JS API, but you might try using JSweet to convert Java to JS or TS (problems with converting jars to to JS). Maybe start with this: https://github.com/coderextreme/JavaSceneAuthoringInterfaceLibrary<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have found it easier to convert JSON to DOM, because all the infrastructure in X3DOM is set up to use DOM and the infrastructure in X_ITE is to use DOM and VRML.   While it might be preferable to write native JSON events (and I have done things like this, you are welcome to help), the work is unfinished.  Real PROTOs are present in X_ITE, but not X3DOM (there is a “proto expander” for JSON documents). I don’t know the proper status of Scripts in X3DOM.  What’s important there is routing to and from the Script.<o:p></o:p></p><p class=MsoNormal><br>If you were to take on a pure JS API, I would recommend using modules in JavaScript, if they are still in the standard.   That way you can limit the amount of code you load.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><br>There is very little reason to use a JS library unless you are writing Scripts in my examples. I recommend getting help here and other places in order to get the minimum of scripting required (for example, Emitters encapsulate random numbers).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If you share your use cases, you may be able to get a better leg up.  It sure helped me.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Good luck,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>> I also had some curiosity about what it takes to WRITE a JS library like the X3D "parser", I guess you could call it....?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>John Carlson has created X3DJSONLD open-source library:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>             https://github.com/coderextreme/X3DJSONLD<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>