[x3d-public] X3DJSAIL XML output error I think. nested ' apostrophe characters?

Don Brutzman brutzman at nps.edu
Sun Feb 26 23:33:00 PST 2017


so the error appears to be in the X3DJSAIL toStringX3D() exporter.

changed SFString and MFString export from entries like

    stringX3D.append(" appinfo='").append(SFStringObject.toString(getAppinfo())).append("'");
to
    stringX3D.append(" appinfo='").append(SFStringObject.toString(getAppinfo()).replace("'","'")).append("'");

looks like it worked, your next example Hub.java had correct line

	meta0_0_14.setContent("wheels' hub");

for which X3DJSAIL was producing invalid content

	<meta name='subject' content='wheels' hub'/>

but now creates an intermediate .x3d file, as desired, with

	<meta name='subject' content='wheels' hub'/>

On 2/26/2017 10:54 PM, Don Brutzman wrote:
> looks like this might be a problem with handling of nested ' apostrophe characters?
>
> we could get rid of those in original source, but frankly they are there to provoke this kind of interoperability issue (bwa ha ha...)
>
> it is better to deal with them correctly since "content in the wild" is guaranteed to have them.
>
> On 2/26/2017 12:45 PM, yottzumm at gmail.com wrote:
>> From this line:
>>
>>
>>
>>                 <field name='isMaster' accessType='outputOnly' appinfo='Whether networkMode 'networkWriter' (output to network as master entity at writeInterval) is true/false' type='SFBool'/>
>>
>>
>>
>> See attached XML.
>>
>>
>>
>> John
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>>
>>
>>
>> *From: *yottzumm at gmail.com <mailto:yottzumm at gmail.com>
>> *Sent: *Sunday, February 26, 2017 7:19 AM
>> *To: *Don Brutzman <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>; Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
>> *Subject: *X3DJSAIL XML output error I think. Could be the Java, not sure.
>>
>>
>>
>> www_web3d_org/x3d/content/examples/Basic/DistributedInteractiveSimulation/RadioCommunicationsPrototypes.java
>>
>> [Fatal Error] RadioCommunicationsPrototypes.new.json.intermediate.x3d:35:94: Element type "field" must be followed by either attribute specifications, ">" or "/>".
>>
>> 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 "/>".
>>
>>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:815)
>>
>>         at www_web3d_org.x3d.content.examples.Basic.DistributedInteractiveSimulation.RadioCommunicationsPrototypes.main(RadioCommunicationsPrototypes.java:2956)
>>
>>
>>
>
>
> all the best, Don


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list