<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>I think I understand why entities are handled properly in the output XML and not the intermediate XML.  It’s because it’s running under JavaScript, and JavaScript means HTML, I think.</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>Wednesday, May 24, 2017 10:33 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL:Interestingexception,but...tableforstringconversionexamples</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>More issues with scripts.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Backslashed \’ gets the \ taken out.  There’s also an entity issue.  Not sure where that came from.  It’s in the intermediate XML and the output JSON, but not in the Java or Nashorn XML output or JavaScript (not included).  All my XML output comes from Nashorn, and the Serializer is very slightly different, doing a  replace(/\\\\"/g, '\\\"') in MFStrings.  That probably isn’t right, and I don’t test the JavaScript too much, but it may affect my XML output, FYI.  Not that I report much on XML output beside intermediate output.  I will watch for differences.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>See attached data and Java and diffs.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>diff is between CameraPrototypes.x3d and CameraPrototypes.new.json.intermediate.x3d<o:p></o:p></p><p class=MsoNormal>[ not complete ]<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There’s also an issue with my serialized DOM from JSON, changing the script to add end tags in the script, but I won’t reveal that.  Whoops.  Hmm.  I am not sure if that is a good idea or not.  I will have to think on it some…<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>See original JSON, Original XML, Intermediate XML<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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 9:33 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interestingexception,but...tableforstringconversionexamples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Note red below.<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 8:39 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception,but...tableforstringconversionexamples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The problem with the script appears to be a problem with X3dToJson.xslt.  JSON attached.  See previous message for XML.  Note that the \” that appears in the script in the XML is not \\\” <span style='color:red'>in the JSON</span>.  This I believe is the MFString in a Script problem I mentioned before. I am not sure if this should be fixed.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am not changing my serializers yet.<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 8:24 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception, but...tableforstringconversionexamples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Perhaps I spoke too soon.  Look at this Java code, original XML and Intermediate XML output and final X3d output.  Particularly, look at the Java code and original XML to see if you can see any problems with it (I believe if there are problems, we will have to document how to program Java for X3DJSAIL-there is a problem with the script I see—I will try to change my serializer, mentioned before I think).  Then fully compare the areas of controversy in the text.x3d with the output XML to see how they differ.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This should be output from original X3DJSAIL, but please by all means run the java against your code base.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Also, once patches are in place, retest X3dToJava.xslt.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 7:53 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception, but ...tableforstringconversionexamples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That was the original X3D XML, not the output from X3DJSAIL.  Run the program to get the output.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think X3DJSAIL will be in pretty good shape for release once we get this patch in.<o:p></o:p></p><p class=MsoNormal>We will have to retest X3dToJava.xslt though I think, unfortunately.<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 7:45 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception, but ... tableforstringconversionexamples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As you can see from the original X3DJSAIL output from my code, it does need to be patched for MFString String arrays.  I recommend patching X3DJSAIL until my code produces the right output for MFString String arrays.  Then we will handle the other things as they appear.  Here is my code and XML again for testing.<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 7:20 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception, but ... tableforstringconversion examples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Okay, here is the original X3DJSAIL output from your and my programs:<o:p></o:p></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><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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 7:10 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>RE: X3DJSAIL: Interesting exception, but ... table forstringconversion examples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Okay, with my patches.  Here the X3D, your and my code (same filename), and the output X3D.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I will report without patches later.<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>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:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, May 24, 2017 2:13 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Subject: </b>Re: X3DJSAIL: Interesting exception, but ... table for stringconversion examples<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>I believe the reason you cannot see the problem is because you do not use arrays for MFStrings in your app code (try with both one and two SFStrings, and a quote in the SFstring at the end).<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>But I could be wrong. Will try to diagnose later.<o:p></o:p></p></div><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 24, 2017 12:59 PM, "John Carlson" <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.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><p class=MsoNormal style='margin-left:38.4pt'>The only part I see left is getting the end part of an MFString correct in all cases in XML generation, both in your code and my code. but there's probably more out there.   I recall there being a problem with MFStrings in Scripts as well, but the code was equivalent, so I left it alone.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:38.4pt'><o:p> </o:p></p><div><p class=MsoNormal style='margin-left:38.4pt'>On May 24, 2017 10:22 AM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<o:p></o:p></p></div></div></blockquote></div></div><p class=MsoNormal style='margin-left:9.6pt'>OK John, thanks for persisting on this one!  Agreed very important... am thinking/hoping I finally understand the mismatch.<br><br>Conceptual error: the excess backslashes come from incorrectly trying to represent the XML value in the Java and JSON, rather than trying to represent the in-memory string array that is needed in the Java and JSON.<br><br>Possible root cause: specification -> XML -> Xpath -> XSLT -> recursion <- recursion -> .java/.json dizziness!<br><br>Email text/html awkwardness coupled with escaping of escaping of escaping hasn't helped us either.<br><br>How to regain clarity... let's build an HTML table that compares equivalences for<br><br>- value<br>- rendering<br>- XML .x3d<br>- ClassicVRML<br>- JSON<br>- Java<br><br>Putting it on an HTML table will help us avoid email twists that occur with reply indenting, mailer issues etc.<br><br>If the result makes sense, it will help us "zero in" on specific conversion pairs that are questionable.  If it works, will probably be useful for X3D Scene Authoring Hints.<br><br>More to follow in the next day or so...  once we get clear on each curious case, calibrating the stylesheet converters will be straightforward at this point.<br><br>all the best, Don<br>-- <br>Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" target="_blank">+1.831.656.2149</a><br>X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" target="_blank">http://faculty.nps.edu/brutzman</a><o:p></o:p></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><p class=MsoNormal><o:p> </o:p></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><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>