<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>Roy, I’ve got a file F16.x3d with the first case, and I need to know how to handle it, perhaps by making X3dToJson.xslt keel over and complain.  I’m trying to fix X3dToJson.xslt, to convert the X3D (if legal) to JSON.  I believe I have my own copy of X3dToJson.xslt.  I am hoping my copy will be accepted, if it’s doing the right thing.  I do have some cases it’s failing on, but perhaps the standard one would fail as well.  More work!  Attached.</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:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Sent: </b>Friday, May 19, 2017 6:45 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">'John Carlson'</a>; <a href="mailto:x3d-public@web3d.org">'X3D Graphics public mailing list'</a>; <a href="mailto:brutzman@nps.edu">'Don Brutzman'</a><br><b>Subject: </b>RE: question on MFStrings in XML.</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>Hi John,<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>Let’s remember that the string field in the Text node is of type MFString.<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>Yes. These two examples would be encoded differently in JSON.<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>No. The first is not an illegal expression, or is it. Reviewing ISO/IEC 19776-1 clause 5.15 SFString and MFString (<a href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString">http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString</a>) there is no mention of white space separators. However, clause 5.1.2 Description (<a href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2">http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2</a>) does say that “Multiple-valued fields are written as an ordered list of values enclosed in quotations and separated by whitespace.”. So whitespace seems to be required. Since SFString values have quotation marks as delimiters, the requirement for whitespace could be considered superfluous. So, implementations may, or may not, expect it. In conclusion, perhaps the first example is illegal. <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’m trying to follow what you want, in each case. I’ll look at each in turn.<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>The first line reads (with added spaces for readability):<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal>-                        <Text string=' "Target Locked" " FIRE!..""(Green Button)" '/><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>This could be parsed as three separate strings. Namely “Target Locked”, then “ FIRE!..”, and finally “(Green Button)”. Or perhaps just as two strings, the second being “ FIRE!..” and the remainder is lost. Or perhaps the parser will complain about it and fall over.<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>The second line reads (<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal>+                        <Text string=' "Target Locked" " FIRE!..\"\"(Green Button)” ’<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>This will be parsed as two separate strings. Namely “Target Locked”, and then “ FIRE!..\”\”(Green Button)”. When displayed, the escaping should then render the second string as <span style='color:#00B050'>FIRE!..””(Green Button)</span>.<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>What do you want to render? Then we can work out the correct encoding, for both JSON and XML.<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>All the best,<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><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> John Carlson [mailto:yottzumm@gmail.com] <br><b>Sent:</b> 19 May 2017 10:59<br><b>To:</b> X3D Graphics public mailing list <x3d-public@web3d.org>; Don Brutzman <brutzman@nps.edu>; Roy Walmsley <roy.walmsley@ntlworld.com><br><b>Subject:</b> RE: question on MFStrings in XML.<o:p></o:p></p></div></div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal>Should these two examples be encoded differently in JSON?  That is my question!  Is the first an illegal expression?<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>Friday, May 19, 2017 2:37 AM<br><b>To: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:brutzman@nps.edu">Don Brutzman</a>; <a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Subject: </b>question on MFStrings in XML.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-                        <Text string='"Target Locked" " FIRE!..""(Green Button)"'/><o:p></o:p></p><p class=MsoNormal>+                        <Text string='"Target Locked" " FIRE!..\"\"(Green Button)<a href="mailto:%22'/%3e%0d%0dAre%20these%20equivalent%20or%20not? %20Thanks!%0d%0dThe%20first%20is%20from%20the%20Savage%20examples.%0d%0bHere's%20how%20I'm%20encoding%20it%20in%20JSON:%0d%0d     %20                       %22@string%22:%5b%22Target">"'/></a><span class=MsoHyperlink><o:p></o:p></span></p><p class=MsoNormal><span class=MsoHyperlink><a href="mailto:%22'/%3e%0d%0dAre%20these%20equivalent%20or%20not? %20Thanks!%0d%0dThe%20first%20is%20from%20the%20Savage%20examples.%0d%0bHere's%20how%20I'm%20encoding%20it%20in%20JSON:%0d%0d     %20                       %22@string%22:%5b%22Target">Are these equivalent or not?  Thanks!</a><o:p></o:p></span></p><p class=MsoNormal><span class=MsoHyperlink><a href="mailto:%22'/%3e%0d%0dAre%20these%20equivalent%20or%20not? %20Thanks!%0d%0dThe%20first%20is%20from%20the%20Savage%20examples.%0d%0bHere's%20how%20I'm%20encoding%20it%20in%20JSON:%0d%0d     %20                       %22@string%22:%5b%22Target">The first is from the Savage examples.</a><o:p></o:p></span></p><p class=MsoNormal><span class=MsoHyperlink><a href="mailto:%22'/%3e%0d%0dAre%20these%20equivalent%20or%20not? %20Thanks!%0d%0dThe%20first%20is%20from%20the%20Savage%20examples.%0d%0bHere's%20how%20I'm%20encoding%20it%20in%20JSON:%0d%0d     %20                       %22@string%22:%5b%22Target"><br>Here’s how I’m encoding it in JSON:</a><o:p></o:p></span></p><p class=MsoNormal><span class=MsoHyperlink><a href="mailto:%22'/%3e%0d%0dAre%20these%20equivalent%20or%20not? %20Thanks!%0d%0dThe%20first%20is%20from%20the%20Savage%20examples.%0d%0bHere's%20how%20I'm%20encoding%20it%20in%20JSON:%0d%0d     %20                       %22@string%22:%5b%22Target">                             "@string":["Target</a></span> Locked"," FIRE!..\"\"(Green Button)"]<span class=MsoHyperlink><o:p></o:p></span></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>