<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’ll have to figure out what to do for \"  and "  in DOM SFStrings so I’m doing the right thing.  I’m currently replacing them with &quot; in my JavaSerializer.js.  Not sure if the main Java program should contain XML entities, or if that should be a feature of X3DJSAIL.  Hopefully, you are handling &, < and > in SFStrings and MFstrings as well (hint).  I should probably let X3DJSAIL convert " to &quot; if possible, at least in SFStrings.  We shall see if my DOM MFString handler passes mustard (do I have to check for &quot; ", &quot; &quot; and " &quot; as well?)—the handler probably will since we come from JSON originally.  I have to remember that I’m working with DOM and not JSON or XML.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I will also readdress what is happening in SourceCode with single quotes.  I think right now, the Java doesn’t compile, so there’s some work on my end.  Right now, the monstrosity looks like:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                } else if (element.childNodes.hasOwnProperty(cn) && node.nodeType == 4) {</p><p class=MsoNormal>                        str += "                "+element.nodeName+n+'.setSourceCode("'+node.nodeValue.replace(/"/g, '\\"').replace(/\\n'/, "\\n'").split("\r\n").join('\\n\"+\n\"')+'");\n';<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Oh, lovely, I just discovered appendSourceCode() that should help.  Or I will use Array.map to do the substitutions after first splitting along newlines.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</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:brutzman@nps.edu">Don Brutzman</a><br><b>Sent: </b>Monday, February 27, 2017 2:33 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Subject: </b>Re: X3DJSAIL XML output error I think. nested &apos; apostrophecharacters?</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>so the error appears to be in the X3DJSAIL toStringX3D() exporter.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>changed SFString and MFString export from entries like</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    stringX3D.append(" appinfo='").append(SFStringObject.toString(getAppinfo())).append("'");</p><p class=MsoNormal>to</p><p class=MsoNormal>    stringX3D.append(" appinfo='").append(SFStringObject.toString(getAppinfo()).replace("'","&apos;")).append("'");</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>looks like it worked, your next example Hub.java had correct line</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                meta0_0_14.setContent("wheels' hub");</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>for which X3DJSAIL was producing invalid content</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                <meta name='subject' content='wheels' hub'/></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>but now creates an intermediate .x3d file, as desired, with</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                <meta name='subject' content='wheels&apos; hub'/></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 2/26/2017 10:54 PM, Don Brutzman wrote:</p><p class=MsoNormal>> looks like this might be a problem with handling of nested &apos; apostrophe characters?</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> we could get rid of those in original source, but frankly they are there to provoke this kind of interoperability issue (bwa ha ha...)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> it is better to deal with them correctly since "content in the wild" is guaranteed to have them.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> On 2/26/2017 12:45 PM, yottzumm@gmail.com wrote:</p><p class=MsoNormal>>> From this line:</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>>>                 <field name='isMaster' accessType='outputOnly' appinfo='Whether networkMode 'networkWriter' (output to network as master entity at writeInterval) is true/false' type='SFBool'/></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>>> See attached XML.</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>>> John</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 Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10</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>>> *From: *yottzumm@gmail.com <mailto:yottzumm@gmail.com></p><p class=MsoNormal>>> *Sent: *Sunday, February 26, 2017 7:19 AM</p><p class=MsoNormal>>> *To: *Don Brutzman <mailto:brutzman@nps.edu>; X3D Graphics public mailing list <mailto:x3d-public@web3d.org>; Roy Walmsley <mailto:roy.walmsley@ntlworld.com></p><p class=MsoNormal>>> *Subject: *X3DJSAIL XML output error I think. Could be the Java, not sure.</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>>> www_web3d_org/x3d/content/examples/Basic/DistributedInteractiveSimulation/RadioCommunicationsPrototypes.java</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> [Fatal Error] RadioCommunicationsPrototypes.new.json.intermediate.x3d:35:94: Element type "field" must be followed by either attribute specifications, ">" or "/>".</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Exception in thread "main" org.web3d.x3d.sai.X3DException: outputFile not writable: C:\Users\coderextreme\X3DJSONLD\www_web3d_org\x3d\content\examples\Basic\DistributedInteractiveSimulation\RadioCommunicationsPrototypes.new.json, IOException when transforming and creating fileName www_web3d_org\x3d\content\examples\Basic\DistributedInteractiveSimulation\RadioCommunicationsPrototypes.new.json, unable to save result: org.xml.sax.SAXParseException; systemId: file:/C:/Users/coderextreme/X3DJSONLD/www_web3d_org/x3d/content/examples/Basic/DistributedInteractiveSimulation/RadioCommunicationsPrototypes.new.json.intermediate.x3d; lineNumber: 35; columnNumber: 94; Element type "field" must be followed by either attribute specifications, ">" or "/>".</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:815)</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>         at www_web3d_org.x3d.content.examples.Basic.DistributedInteractiveSimulation.RadioCommunicationsPrototypes.main(RadioCommunicationsPrototypes.java:2956)</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>> all the best, Don</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>