<p dir="ltr">Perhaps it's time for me to dig into Cobweb and X3DOM to see how they can be extended to support JSON? If it's through DOM, which is fine by me, I would have to look and see how the various encodings are loaded after DOM is loaded.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Dec 4, 2016 1:40 AM, "John Carlson" <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Again, the X3D JSON Loader is a proof of concept patch until we get full JSON support in Cobweb and X3DOM, if desired.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Dec 4, 2016 1:24 AM, "John Carlson" <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Because I may not have the full x3d examples downloaded. And I do want to test to see if JSON inclusion works.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Dec 2, 2016 3:04 PM, "Andreas Plesch" <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi John,<div><br></div><div>I tried a bit to load gears.json with X3DJSONLD:</div><div><br></div><div><a href="https://raw.githubusercontent.com/andreasplesch/X3DJSONLD/master/AP_minimal_JSLD.html" target="_blank">https://raw.githubusercontent.<wbr>com/andreasplesch/X3DJSONLD/ma<wbr>ster/AP_minimal_JSLD.html</a><br></div><div><br></div><div>But even before any script parsing/loading, there is a problem with the ExternProtoDeclare node in gears.json. It has a url field to Rotor.x3d which is replaced by the json loader with Rotor.json before being handed off to cobweb with importDocument(). Cobweb does not know what to do with the Rotor.json file and gives up.</div><div><br></div><div>Why modify the url field value ? If the scene author wants to use a .json encoded scene, she will put it in the url field just like a .wrl encoded scene.</div><div><br></div><div>On another note, I agree that eval() cannot be avoided if script should be supported. cobweb itself also uses eval() (after some setup and massaging) to run the x3d script.</div><div><br></div><div>type="application/x-vrmlscript<wbr>" is necessary because without it the web browser will try to run the script "as is" as soon as it gets appended to the page DOM. When cobweb gets a chance to check for the type attribute, it is already too late. So it cannot use the attribute to prevent it from running. It can only not reject it which is what it does.</div><div><br></div><div>-Andreas</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 1:02 AM, <span dir="ltr"><<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="#954F72"><div class="m_-637341298042191590m_4670831100320161873m_3334206258020055149m_-8313888796625588714WordSection1"><p class="MsoNormal">It appears that Cobweb is fouled up with DOM loading of scripts, even with the additional name value pair. See gears.x3d/gears.json and load DOM through importDocument. And independent test would help. I am not sure which of my X3DCanvases gets loaded first and I am using absolute indexing, so it could be the XML loaded one that is failing. Basically, we need a good way to load scripts coming in through JSON I think, and the only real way I know how to do it is eval or cobweb with JSON to XML conversion and VRMLscript. If Cobweb could use the VRMLscript from JSON or DOM, that might be ideal.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">This is with cobweb 2.4.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">John</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"><u></u> <u></u></p><div style="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" target="_blank">yottzumm@gmail.com</a><br><b>Sent: </b>Thursday, December 1, 2016 12:32 AM<br><b>To: </b><a href="mailto:andreasplesch@gmail.com" target="_blank">Andreas Plesch</a>; <a href="mailto:brutzman@nps.edu" target="_blank">Don Brutzman</a>; <a href="mailto:roy.walmsley@ntlworld.com" target="_blank">Roy Walmsley</a><br><b>Subject: </b>FW: loading X3D DOM. Latest Cobweb techniques?</p></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Would it be possible to get a name/value of <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">"@<span class="m_-637341298042191590m_4670831100320161873m_3334206258020055149m_-8313888796625588714html-attribute-name"><span style="font-size:13.5pt;font-family:"Courier New"">type"</span></span><span style="font-size:13.5pt;font-family:"Courier New";color:#881280"> : "</span><span class="m_-637341298042191590m_4670831100320161873m_3334206258020055149m_-8313888796625588714html-attribute-value"><span style="font-size:13.5pt;font-family:"Courier New"">application/x-vrmlscript"</span></span><span style="font-size:13.5pt;font-family:"Courier New";color:#881280"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Courier New";color:#881280"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Courier New";color:#881280">On the Script tag in X3D JSON? I will do some testing here first to see if it will help.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Courier New";color:#881280"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Courier New";color:#881280">John</span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></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" target="_blank">yottzumm@gmail.com</a><br><b>Sent: </b>Thursday, December 1, 2016 12:24 AM<br><b>To: </b><a href="mailto:andreasplesch@gmail.com" target="_blank">Andreas Plesch</a><br><b>Subject: </b>RE: loading X3D DOM. Latest Cobweb techniques?<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">One thing I noticed once I got both DOM and XML views loaded, was that I think the DOM VRML script tag was disabled, but the XML one worked. Was there some attribute to add to the Script tag to make it work? Can I add it in both XML and DOM? Thanks, John I will start email search.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-637341298042191590m_4670831100320161873m_3334206258020055149gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>