<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>How are \\\\ (double backslash) and Π (Π) supposed to be used in a MFStringObject with String array initialization in Java? Run this java program to get output JSON, then investigate the characters.</p><p class=MsoNormal>In Java, they appear on line 121, attached.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It looks like \\\\ goes to \\ in JSON, when it should go to \\\\</p><p class=MsoNormal>And Π goes to Î (two characters)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>X3dToJson.xlst produces this:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> "@string":["Character entity substitutions:","empty string \"\" skips a line:","","apostrophe ' is '","ampersand & is &","quote mark \" is "","backslash \\ is X3D escape character","double backslash \\\\ is X3D backslash \\ character","Pi Π is Π XML character entity"],</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>--------------------------------------------------------------------------------------------------------------------------------------------------------------<br>Note that this in Java (but why are there two MFStringObjects???—generated from X3dToJava.xslt):</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> private MFStringObject DefaultText_4_15_string = new MFStringObject(new MFStringObject("\"Character entity substitutions:\" \"empty string \\\"\\\" skips a line:\" \"\" \"apostrophe ' is '\" \"ampersand & is &\" \"quote mark \\\" is "\" \"backslash \\\\ is X3D escape character\" \"double backslash \\\\\\\\ is X3D backslash \\\\ character\" \"Pi Π is Π XML character entity\""));</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Produces this:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>"@string":["Character entity substitutions:\" \"empty string \\"\\" skips a line:\"</p><p class=MsoNormal>\"\" \"apostrophe ' is &apos;\" \"ampersand & is &amp;\" \"quote mark \\" is &quot;\"</p><p class=MsoNormal>\"backslash \\ is X3D escape character\" \"double backslash \\\\ is X3D backslash</p><p class=MsoNormal>\\ character\" \"Pi Π is &#928; XML character entity"],</p><p class=MsoNormal>---------------------------------------------------------------------------------------------------------------------------------------------------------------</p><p class=MsoNormal>But I would like to use this, as it makes a lot more sense to me:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> return new MFStringObject(new java.lang.String[] {"Character entity substitutions:","empty string \"\" skips a line:","","apostrophe ' is '","ampersand & is &","quote mark \" is "","backslash \\ is X3D escape character","double backslash \\\\ is X3D backslash \\ character","Pi Π is Π XML character entity"});</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Produces this:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> "@string":["Character entity substitutions:","empty string \"\" skips a line:","","apostrophe ' is '","ampersand & is &","quote mark \" is "","backslash \\ is X3D escape character","double backslash \\ is X3D backslash \\ character","Pi Î is Π XML character entity"],</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>---------------------------------------------------------------------------------------------------------------------------------------------------------------</p><p class=MsoNormal>What does the SAI standard say? Does X3DJSAIL conform to the standard? What does the X3D JSON say for MFStrings? What happens when we convert the new JSON to Java? Shouldn’t the output of X3DJSAIL be similar to X3dToJson.xslt?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p></div></body></html>