[x3d-public] X3DJSAIL: Comments are different in JSON outputs from HelloWorldProgram.java and HelloWorldProgramOutput.java
Don Brutzman
brutzman at nps.edu
Sun Jan 7 14:32:40 PST 2018
Yes they are different and the test cases are exceptional.
Comments contain literal characters. Literally "whatever."
XML has character entities which allow special characters, for example & is the ampersand character.
List of XML and HTML character entity references
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
X3D SFString and MFString values can have such special characters, but also must escape quotation marks in order to distinguish between a rendered " in X3D dispay or else a simple SF/MFString delimiter.
X3D Tooltips: type Definitions
http://www.web3d.org/x3d/content/X3dTooltips.html#type
X3D Tooltips: MFString
http://www.web3d.org/x3d/content/X3dTooltips.html#MFString
On 1/2/2018 12:27 PM, John Carlson wrote:
> X3DJSAIL: Comments are different in JSON and XML outputs from HelloWorldProgram.java and HelloWorldProgramOutput.java in X3DJSAIL examples. Differences between the JSON and XML include these diffs:
>
> $ diff HelloWorldProgramOutputOutput.json ../../examples/HelloWorldProgramOutput.json
>
> 931,943c931
>
> < "#comment":"Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e."
>
> < },
>
> < {
>
> < "#comment":"<Appearance DEF='DeclarativeAppearanceExample'>"
>
> < },
>
> < {
>
> < "#comment":"<!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - ->"
>
> < },
>
> < {
>
> < "#comment":"<ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/>"
>
> < },
>
> < {
>
> < "#comment":"</Appearance>"
>
> ---
>
> > "#comment":"Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. <Appearance DEF='DeclarativeAppearanceExample'> <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> </Appearance>"
>
> $ diff HelloWorldProgramOutputOutput.x3d ../../examples/HelloWorldProgramOutput.x3d
>
> 106,107d105
>
> <
>
> <
>
> 115d112
>
> <
>
> 211,212d207
>
> <
>
> <
>
> 236d230
>
> <
>
> 254,258c248,252
>
> < <!-- Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e. -->
>
> < <!-- <Appearance DEF='DeclarativeAppearanceExample'> -->
>
> < <!-- <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - -> -->
>
> < <!-- <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/> -->
>
> < <!-- </Appearance> -->
>
> ---
>
> > <!-- Test success: x3dModel.findNodeByDEF(DeclarativeAppearanceExample) = <Appearance DEF='DeclarativeAppearanceExample'/> i.e.
>
> > <Appearance DEF='DeclarativeAppearanceExample'>
>
> > <!- - DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance - ->
>
> > <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/>
>
> > </Appearance> -->
>
> I’d say if we’re only worried about comments, we’ve come quite a ways.
>
> John
>
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