<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;}
@font-face
        {font-family:"Times New Roman \,serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        color:black;}
p.m7357056672881959298msonormal, li.m7357056672881959298msonormal, div.m7357056672881959298msonormal
        {mso-style-name:m_7357056672881959298msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
.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;}
/* List Definitions */
@list l0
        {mso-list-id:239797415;
        mso-list-type:hybrid;
        mso-list-template-ids:1491605080 -1 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><ol style='margin-top:0in' start=1 type=1><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>You don’t have to have HTML script in <script></script>  you can eval them.  You do need X3D Script fields for ROUTES. I am asking for script fields, not script tags.  I am fine with the HTML script node, except I just want fields that I can route to.  If you provide ROUTEs to non-X3D things that would be an OK alternate by me, too, or a just way to convert X3D Script-based ROUTEs to JavaScript.</li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Self-modifying scripts are a bad idea. LOL.</li></ol><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Again, I am not asking for strict X3D Scripts.  I can build an SAI library or get one if I want to.  I am asking for a way to ROUTE between X3D and JavaScript (and by happy circumstance, JavaScript to JavaScript).  That is how you need to keep X3D relevant, if you want to maintain a standard, and that’s how you make everyone happy.  If there’s a conversion tool, that’s OK by me.  Are you going to write it?</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:Leonard.Daly@realism.com">Leonard Daly</a><br><b>Sent: </b>Monday, May 22, 2017 11:01 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Subject: </b>Re: [x3dom-users] Cobweb_dom...Script Magic? Loading DOMsubscenesafter parent in X3DOM and Cobweb. ALMOST complete, requiressequencing ofouter functions.</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 5/22/2017 7:12 AM, John Carlson wrote:<o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>The Script AND the Proto problem have ben solved in the HTML environment, I believe, with Cobweb + Cobweb DOM, or close to it.  See Cobweb 3.2.<o:p></o:p></p></blockquote><p class=MsoNormal><span style='color:black'><br>John,<br><br>Script is very far from being solved, and (I believe) unsolvable with the constraints of X3D and DOM. These are my reasons.<br>1) There is a name conflict so X3D Script cannot be in the same namespace as HTML's Script. HTML only has one namespace<br>2) DOM allows scripts to modify themselves or be modified by other scripts. This is not possible in Cobweb or Cobweb_DOM.<br><br>3) If you create a new node called (for example) X3dScript replacing the current X3D's Script node you solve (1) and because it's not JavaScript in the DOM, (2) is irrelevant. Now a scene has two different scripting environments. Even though the code looks to be the same (written in the same language), one cannot access fields, methods, properties, etc. of the other. They have different calling mechanisms. The X3dScript node code cannot respond to HTML events (mouseover, click, typing, etc in HTML elements). The HTML/DOM Script code can only interact with X3D elements through X3D's SAI. This design would produce an environment that has minimal (even less than current X3D) adoption. It would be confusing to developers with no obvious reason to the separate design. <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><br>Leonard Daly</span><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>John<o:p></o:p></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<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:Leonard.Daly@realism.com">Leonard Daly</a><br><b>Sent: </b>Monday, May 22, 2017 10:06 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:x3dom-users@lists.sourceforge.net">x3dom-users@lists.sourceforge.net</a>; <a href="mailto:andreasplesch@gmail.com">Andreas Plesch</a>; <a href="mailto:holger.seelig@yahoo.de">holger.seelig@yahoo.de</a><br><b>Subject: </b>Re: [x3dom-users] Cobweb_dom...Script Magic? Loading DOM subscenesafter parent in X3DOM and Cobweb. ALMOST complete, requires sequencing ofouter functions.<o:p></o:p></p></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>John,<br><br>I have not been convinced that Protos need to exist in an HTML environment. Scripts are an integral piece of the Proto architecture so if you path is to implement Protos on the way to implementing Scripts, you need to solve the entire Script problem first. If Scripts are optional, then why have Proto? I think something like a macro expansion can solve all of the use cases where Proto would be used while being lighter weight and easier to implement and possibly use.<br><br>Leonard Daly<br><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Leonard, I believe Scripts should be implemented AFTER Protos.   Just my opinion.  Once the Protos and the ROUTEs and the Scripts are expanded with the new DEFs, then you apply the event model.   This makes things easier, but takes more memory.   Then you optimize.   Beware premature optimization. <o:p></o:p></p><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal>John<o:p></o:p></p></div></div><div><p class=MsoNormal> <o:p></o:p></p><div><p class=MsoNormal>On May 21, 2017 12:16 AM, "Leonard Daly" <<a href="mailto:Leonard.Daly@realism.com">Leonard.Daly@realism.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:76.8pt'>John,<br><br>I don't really like to answer this way, but why?<br><br>X3DOM does not have Proto/ExternProto feature. It does not have X3D Script node. The integration with HTML is too close to allow an X3D Script node. HTML JavaScript (via DOM and X3D node manipulation) is available and used extensively. X3DOM does not handle VRML (meaning a text file with {} syntax). There is an unofficial JSON loader. Perhaps you have one too. How does it get the scene graph into DOM? Does it create DOM elements (or perhaps an HTML text string which is then parsed)? Something else?<br><br>To the extent I understand your question, you are asking for help in constructing a means of handling X3D Script node in X3DOM. Once that is done, Proto/ExternProto would be next. This would all come into the browser through an JSON encoded file. It seems to me that trying to handle X3D Script code requires an entire infrastructure supporting the X3D event mode and calling script code with X3D arguments. It also requires building full support for SAI and supporting the 'directOutput' field. That is a major effort with no obvious purpose that I see in V4.<br><br>You are asking for some serious time support (I think) into an application that is neither fully X3D-compliant, nor DOM-compliant (but the closest to both that is available). At least for me, I do not understand how this effort would further an X3D integrated DOM system. I am quite willing to listen to your reasons and help where I can, but I would like to see where this is going first.<br><br>Leonard Daly<br><br>P.S.  Everything above is for client-side code. Server side code can manipulate things as much as it wants to create something that runs in a client-side browser.<br><br>P.P.S. I do think there is a need to JSON encoding in V4 subject to the node definition for V4.<br><br><br><br><o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='margin-left:112.8pt'>Yes, Leonard, for quite some time I have an X3D JSON PROTOtypeExpander.js that works with X3D PROTOs and EXTERNPROTOs and displays in X3DOM.  I don’t know how complete it is, and testers are welcome. My EXTERNPROTO expander runs on the server, so is not included in the message, but it is included in the link in the original message.  If someone can make the EXTERNPROTO expander work client side that would be great.<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>The EXTERNPROTO expander is generally called like:<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>                json = externPrototypeExpander(outfile, json);<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Where json is the parent json of the extern, and outfile is the parent X3D file being loaded (I think “” will probably do in a pinch.  I am not sure.).  The extern PROTOs will be included in the original JSON as a ProtoDeclare object.  You may have to run the flattener afterwards, and it is run as:<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><span style='font-size:14.0pt'>            json = flattener(json);</span><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><span style='font-size:14.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>It removes empty objects from the JSON.<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Yes, I would like someone to help me with VRMLScript for X3DOM, if someone is available.  I have a very barebones and incorrect implementation here:<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Script.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Script.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Please help.  I don’t know the X3D event model, and I’m not likely to learn soon.  The X3D event model can be emulated in Browser-side JavaScript, but there’s only Cobweb for proof.<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><br>I have another version of flipper.html here that works with X3DOM and Cobweb adding the subscene later.  It works with Promises, but the functions still aren’t separated…close, but no cigar.  Take a look:<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html</a><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Sorry, I tend to use the XML version of “Proto”, and not the VRML “PROTO”.<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>X3DJSONLD provides an infrastructure for X3D JSON Browser development, including X3D XML -> X3D JSON conversion on the server, and X3D JSON to X3D XML loading into X3DOM and Cobweb.  It also includes conversions from XML DOM to Java and Nashorn JavaScript for X3DJSAIL app development.<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>There is definite potential for an XML PROTO expander, as I have written this code, but not seriously tested:<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>So far, it’s still server-side.  If you’re going to modify it, split it into server and client-side pieces, please.  Complete is probably a misnomer…<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Thanks,<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>John<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10<o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:112.8pt'><b>From: </b><a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard Daly</a><br><b>Sent: </b>Saturday, May 20, 2017 7:17 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com" target="_blank">John Carlson</a>; <a href="mailto:andreasplesch@gmail.com" target="_blank">Andreas Plesch</a>; <a href="mailto:holger.seelig@yahoo.de" target="_blank">holger.seelig@yahoo.de</a><br><b>Cc: </b><a href="mailto:x3dom-users@lists.sourceforge.net" target="_blank">x3dom-users@lists.sourceforge.net</a>; <a href="mailto:x3d-public@web3d.org" target="_blank">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: [x3dom-users] Cobweb_dom...Script Magic? Loading DOM subscenesafter parent in X3DOM and Cobweb.<o:p></o:p></p></div><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:112.8pt'>John,<o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-left:148.8pt'>Cobweb_dom, X3DOM experts, I need some help adding a child DOM scenegraph with prototypes to a parent DOM scenegraph after the <o:p></o:p></p></blockquote><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:112.8pt'><br>Not sure how any of this applies to X3DOM as it does not have PROTOs. Assuming you mean X3D prototypes via PROTO or EXTERNPROTO. If you mean something else, please elaborate.<br><br><br>Leonard Daly<br><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-left:148.8pt'>primary scene has been  loaded, and not before. I have an example of loading before the scene is loaded, and in a callback.  If you have an example with Promises instead of callback nesting, that would be more ideal, the second $.getJSON() (child scenegraph) might finish before the first $.getJSON() (parent scenegraph) if I don’t use promises or callback nesting. Also, Promises would allow me to separate the parent loading somewhat from the child loading, and create separate functions.  Also, X3DOM experts can provide an example with Promises as well.  Meanwhile, I will be reading about Promises.<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>Here is my example so far:<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/html/flipper.html</a><br><br>Viewable here:<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://coderextreme.net/X3DJSONLD/src/main/html/flipper.html" target="_blank">https://coderextreme.net/X3DJSONLD/src/main/html/flipper.html</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>The white Box is the subscene of the dolphin scene.<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>The following related code is from <a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/loaderJQuery.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/loaderJQuery.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>and references code from:<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/X3DJSONLD.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/X3DJSONLD.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>[ actually, I think the last two reference each other – naughty ]<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>Data is here:<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>[ child scenegraph ]<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/abox.json" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/abox.json</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>[ parent scenegraph ]<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/flipp.json" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/flipp.json</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>Cobweb doesn’t need the prototypeExpander or the flattener (well, it might have with prototypes in cobweb_dom, but I think the last release fixed that…haven’t checked—here is a good test for you!).  This is a dual example, and I haven’t figured out how to conditionally run the prototypeExpander on only X3DOM code.  Please test without the PrototypeExpander.js and Flattener.js included, and remove X3DOM, since it won’t work in that case.  X3DOM folks can include the two JavaScript files which are here:<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Flattener.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/Flattener.js</a><o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>You may provide your own appendInline (below) which doesn’t call loadSchema.  That may be too complex of a download.  That is, you probably don’t want to do all that JSON schema validation in your example.  Try to keep my code close to what it is otherwise.<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>And if you start supporting X3D JSON in your viewers, that would be even better!<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>John<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>/**<o:p></o:p></p><p class=m7357056672881959298msonormal style='margin-left:56.25pt;line-height:105%'><span style='font-family:Symbol'>·</span><span style='font-size:7.0pt;line-height:105%;font-family:"Times New Roman ,serif",serif'>         </span>Next is passed the element parameter</p><p class=m7357056672881959298msonormal style='margin-left:56.25pt;line-height:105%'><span style='font-family:Symbol'>·</span><span style='font-size:7.0pt;line-height:105%;font-family:"Times New Roman ,serif",serif'>         </span>*/</p><p class=MsoNormal style='margin-left:148.8pt'>function appendInline(element, url, next) {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>        $.getJSON(url, function(json) {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                if (typeof prototypeExpander === 'function') {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        json = prototypeExpander(url, json, "");<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                } else {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        console.error("Perhaps you need to include the PrototypeExpander.js?");<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                }<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                if (typeof flattener === 'function') {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        json = flattener(json);<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                } else {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        console.error("Perhaps you need to include the Flattener.js?");<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                }<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                // must validate here because we call an inner method.<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                loadSchema(json, url, doValidate, function() {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        ConvertToX3DOM(json["X3D"]["Scene"], "Scene", element, url);<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        next(element);<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                }, function(e) {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                        console.error(e);<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>                });<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>        }).fail(function(jqXHR, textStatus, errorThrown) { alert('getJSON request failed! ' + textStatus + ' ' + errorThrown); });<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>}<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'> <o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>/**<o:p></o:p></p><p class=m7357056672881959298msonormal style='margin-left:1.0in;line-height:105%'><span style='font-family:Symbol'>·</span><span style='font-size:7.0pt;line-height:105%;font-family:"Times New Roman ,serif",serif'>         </span>Next is passed the selected element from selector</p><p class=m7357056672881959298msonormal style='margin-left:1.0in;line-height:105%'><span style='font-family:Symbol'>·</span><span style='font-size:7.0pt;line-height:105%;font-family:"Times New Roman ,serif",serif'>         </span>Selector is the CSS selector to append inline to.</p><p class=m7357056672881959298msonormal style='margin-left:1.0in;line-height:105%'><span style='font-family:Symbol'>·</span><span style='font-size:7.0pt;line-height:105%;font-family:"Times New Roman ,serif",serif'>         </span>*/</p><p class=MsoNormal style='margin-left:148.8pt'>function loadSubscene(selector, url, next) {<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>        appendInline(document.querySelector(selector), url, next);<o:p></o:p></p><p class=MsoNormal style='margin-left:148.8pt'>}<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:148.8pt'><o:p> </o:p></p><pre>------------------------------------------------------------------------------</pre><pre>Check out the vibrant tech community on one of the world's most</pre><pre>engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" target="_blank">http://sdm.link/slashdot</a></pre><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:148.8pt'><o:p> </o:p></p><pre>_______________________________________________</pre><pre>X3dom-users mailing list</pre><pre><a href="mailto:X3dom-users@lists.sourceforge.net" target="_blank">X3dom-users@lists.sourceforge.net</a></pre><pre><a href="https://lists.sourceforge.net/lists/listinfo/x3dom-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/x3dom-users</a></pre></blockquote><p> </p><p class=MsoNormal style='margin-left:112.8pt'>-- <br><b><span style='font-size:13.5pt;color:#333366'>Leonard Daly</span></b><span style='color:#333366'><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i> </span><o:p></o:p></p><p class=MsoNormal style='margin-left:112.8pt'> <o:p></o:p></p></div></blockquote><p> </p><div><p class=MsoNormal style='margin-left:76.8pt'>-- <br><b><span style='font-size:13.5pt;color:#333366'>Leonard Daly</span></b><span style='color:#333366'><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i> </span><o:p></o:p></p></div></div></blockquote></div></div></blockquote><p> </p><p class=MsoNormal>-- <br><b><span style='font-size:13.5pt;color:#333366'>Leonard Daly</span></b><span style='color:#333366'><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i> </span><o:p></o:p></p><p class=MsoNormal><span style='color:black'> </span><o:p></o:p></p></blockquote><p><o:p> </o:p></p><p class=MsoNormal><span style='color:black'>-- <br></span><b><span style='font-size:13.5pt;color:#333366'>Leonard Daly</span></b><span style='color:#333366'><br>3D Systems & Cloud Consultant<br>LA ACM SIGGRAPH Chair<br>President, Daly Realism - <i>Creating the Future</i> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>