<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>Okay, I was able to make gears.json work with the X3D JSON Loader and the server side proto expander with cobweb.  I may have to work on the client side prototype expander some more to make it work with X3DOM (likely it’s a script issue  instead).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>What I did was replace &lt; and &gt; before sending to CreateX3DFromString, avoiding any web browser interpretation.</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>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></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>Saturday, June 18, 2016 3:42 AM<br><b>To: </b><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Cc: </b><a href="mailto:holger.seelig@yahoo.de">Holger Seelig</a>; <a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br><b>Subject: </b>RE: Interesting Example</p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>Okay, I figured out why the X3D JSON Loader wouldn’t load it. When I serialize the JSON to XML, the < and > get converted to &lt; and &gt;.  These are not valid to VRMLScript?  I am not sure.  I will try to do a replacement.  I think the best thing to do may be to create a CDATA Section instead of a text node, but I’m not ready to do that (doesn’t work with HTML, I’d say off the cuff).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I do have this, which appears to be partially working:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>        // Fix CDATA sections</p><p class=MsoNormal>        xmlstr = xmlstr.replace(/&lt;!\[CDATA\[/g, "<![CDATA[");</p><p class=MsoNormal>        xmlstr = xmlstr.replace(/\]\]&gt;/g, "]]>");</p><p class=MsoNormal>        do {</p><p class=MsoNormal>                var xmlstr2 = xmlstr;</p><p class=MsoNormal>                xmlstr = xmlstr2.replace(/(\<\!\[CDATA\[(.|\n)*)&lt;((.|\n)*\]\]\>)/gi, "$1<$3");</p><p class=MsoNormal>        } while (xmlstr !== xmlstr2);</p><p class=MsoNormal>        do {</p><p class=MsoNormal>                xmlstr2 = xmlstr;</p><p class=MsoNormal>                xmlstr = xmlstr2.replace(/(\<\!\[CDATA\[(.|\n)*)&gt;((.|\n)*\]\]\>)/gi, "$1>$3");</p><p class=MsoNormal>        } while (xmlstr !== xmlstr2);</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><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Saturday, June 18, 2016 3:15 AM<br><b>To: </b><a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a>; <a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Cc: </b><a href="mailto:holger.seelig@yahoo.de">Holger Seelig</a>; <a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br><b>Subject: </b>RE: Interesting Example<o:p></o:p></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>This example has a lot of scripting, and I doubt if my prototype expander is up to dealing with scripts yet.  If we could get<o:p></o:p></p><p class=MsoNormal>a version without scripts, I could try loading it.  As it is, even without the prototype expander, the X3D JSON Loader will not load gears.json, even with a Cobweb renderer.  Something to work on.</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><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></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:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Sent: </b>Friday, June 17, 2016 6:32 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a>; <a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Cc: </b><a href="mailto:holger.seelig@yahoo.de">Holger Seelig</a>; <a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br><b>Subject: </b>Interesting Example<o:p></o:p></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Hi,</span><span lang=EN-GB><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have come across an interesting example, relating to the use of Scripts/Prototypes.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>It is on the Cobweb site at <a href="http://titania.create3000.de/cobweb/">http://titania.create3000.de/cobweb/</a>. Scroll down to examples, navigate to Page 3 of the Examples list, and choose “Gears”.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>This example is also available on Holger’s GitHub site at <a href="https://github.com/create3000/Library/tree/master/Examples/Gears">https://github.com/create3000/Library/tree/master/Examples/Gears</a>. There are four files, of which two are XML encoded X3D. The file Rotor.x3d supplies a prototype declaration that is used within gears.x3d.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Try opening the file gears.x3d in different browsers!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I don’t know how you would get on with this one, John, in your prototype expander.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Roy<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>