<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:Monaco;}
/* 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;}
span.m3241027835142879863m-3435999679950297545apple-converted-space
        {mso-style-name:m_3241027835142879863m_-3435999679950297545apple-converted-space;}
.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>Yes, adding a CDATA section fixed the #sourceText.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any comments on whether I should check for text nodes when processing scripts?</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>Thursday, August 2, 2018 12:55 PM<br><b>To: </b><a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D-Public</a><br><b>Subject: </b>Re: [x3d-public] good example for ECMAScripting and Protos?</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>It does check for nodeType === 4 before processing sourceText when running DOM2JSONSerializer.  Worth a shot.</p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, Aug 2, 2018 at 7:34 AM <a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a> <<a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>John</p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I do see that of the files you attrached, SphereDirectedPointSet.new.json does not have the Script source in the json structure, while the other two files do. You didn't mention what X3D->JSON method was used to generate each of your three files.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I can confirm that the X3D->JSON conversion in X3D-Edit (running in NetBeans 8.1) works -- includes the Script source --  , and  a conversion using the X3dToJson.xslt stylesheet and the SaxonHE 9.7 XSLT 2 engine also works.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>However, the Xj3D browser does throw an error reading the SphereDirectedPointSet.x3d; flags the entire source text of t Script node as an unrecognized field value.</p></div><div><p class=MsoNormal>Perhaps it needs to be enclosed in CDATA ?</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Vince</p></div></div><div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><br><br></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Aug 2, 2018, at 3:20 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal>Note:  I was loading XML and it’s being converted to JSON.</p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, Aug 2, 2018 at 3:09 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Here are three JSON files produced by X3DJSONLD.  Two are produced by DOM2JSONSerializer.json, and one is produced by X3dToJson.xslt.  Can anyone see perhaps why the one without #sourceText got messed up?</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Curious.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>John</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href="mailto:yottzumm@gmail.com" target="_blank">John Carlson</a><br><b>Sent: </b>Thursday, August 2, 2018 12:37 AM</p></div></div></div><div><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br><b>To: </b><a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>; <a href="mailto:x3d-public@web3d.org" target="_blank">X3D-Public</a><br><b>Subject: </b>RE: [x3d-public] good example for ECMAScripting and Protos?</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Well, when I run the conversions from the command line, there’s a #sourceText.  IDK what’s happening, except I remove the Scripts from the XML, after sending to the browsers. The only thing I can conclude is that they are being converted back to JSON.  But no other file does the same thing that I’ve found. Hmm.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>John</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href="mailto:yottzumm@gmail.com" target="_blank">John Carlson</a><br><b>Sent: </b>Thursday, August 2, 2018 12:32 AM<br><b>To: </b><a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>; <a href="mailto:x3d-public@web3d.org" target="_blank">X3D-Public</a><br><b>Subject: </b>RE: [x3d-public] good example for ECMAScripting and Protos?</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Vince, I’m trying to identify why the file you give does not have #sourceText when converted to JSON.   Can you try with X3D-edit?</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I will pursue this some.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>John</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a><br><b>Sent: </b>Wednesday, August 1, 2018 9:04 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com" target="_blank">John Carlson</a>; <a href="mailto:x3d-public@web3d.org" target="_blank">X3D-Public</a><br><b>Subject: </b>Re: [x3d-public] good example for ECMAScripting and Protos?</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>See </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="http://www.kshell.com/pages/pointcloudvisualization/SphereDirectedPointSet.x3d" target="_blank">http://www.kshell.com/pages/pointcloudvisualization/SphereDirectedPointSet.x3d</a></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>It is a X3D file with with a Prototype + ecmascript definition of a point cloud, with a vector attached to each point of the cloud.</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Example used is just points randomly distributed on sphere with directs pointed radially outward.</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Potential uses would be to implement the scanning design pattern at <a href="http://x3dgraphics.com/examples/X3dForAdvancedModeling/Scanning/X3dMeshDesignPatternIndex.html" target="_blank">http://x3dgraphics.com/examples/X3dForAdvancedModeling/Scanning/X3dMeshDesignPatternIndex.html</a> , or</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>visualizing fluid flow or  electromagnetic field</p><div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'> </p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Jul 31, 2018, at 10:30 PM, John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is there a good example of ECMAScripting in X3D that I can use to test my X3D JSON ECMAScript preprocessor?  Preferably with Protos<span class=m3241027835142879863m-3435999679950297545apple-converted-space> </span></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks!</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>John</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:9.0pt;font-family:"Monaco",serif'>_______________________________________________<br>x3d-public mailing list<br></span><a href="mailto:x3d-public@web3d.org" target="_blank"><span style='font-size:9.0pt;font-family:"Monaco",serif;color:#954F72'>x3d-public@web3d.org</span></a><span style='font-size:9.0pt;font-family:"Monaco",serif'><br></span><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank"><span style='font-size:9.0pt;font-family:"Monaco",serif;color:#954F72'>http://web3d.org/mailman/listinfo/x3d-public_web3d.org</span></a></p></div></blockquote></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div><p class=MsoNormal style='margin-left:4.8pt'><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>