[x3d-public] compare these two outputs. They should be identical.X3DJSAIL.

Don Brutzman brutzman at nps.edu
Tue Jan 2 16:28:48 PST 2018


OK excellent.  Presumably you think that the \" XML in HelloWorldProgramOuput.x3d is correct and the \\" XML is incorrect.

BTW you found what the test outputs were showing (but I was too tired to notice) last night: mismatches between some file outputs.

===========================================
HelloWorldProgramOutput.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
===========================================
HelloWorldProgramOutput.CommandLine.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: false
===========================================
HelloWorldProgramOutput.xml
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: true
===========================================
HelloWorldProgramOutput.ReloadedDOM.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: false
===========================================

Sorry but OutputOutput.x3d is too confusing/recursive, and uncertain origin.  As before let's stick with diagnosing the existing outputs (in java/examples directory) first.

Checking... here is an example test output for an erroneous version:

===========================================
CommandLine [HelloWorldProgramOutput.x3d, -toX3D, -toFile, HelloWorldProgramOutput.CommandLine.x3d]
parameter: source file HelloWorldProgramOutput.x3d filesize 20714 bytes
parameter: "-toX3D" for conversion to X3D encoding
parameter: "-toFile" "HelloWorldProgramOutput.CommandLine.x3d" for result file name root HelloWorldProgramOutput.CommandLine
convert to X3D:
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput.CommandLine.x3d
file conversion successful: HelloWorldProgramOutput.CommandLine.x3d (20718 bytes)
===========================================

Here is another:

===========================================
Test success: x3dLoader.getDomDocument() and x3dLoader.toStringX3D(domDocument)
Now test x3dLoader.toX3dObjectTree(domDocument)
Warning: toFileX3D() is overwriting prior file HelloWorldProgramOutput.ReloadedDOM.x3d
Test success: x3dLoader.toX3dObjectTree(domDocument), save HelloWorldProgramOutput.ReloadedDOM.x3d
x3dLoader validation result: no issues reported.
===========================================
Test loadModelFromFileX3D(String) and loadModelFromFileX3D(File)
checking both .x3d and .xml encodings:
newX3DModel loadSuccess=true, isEmpty()=false, validate()=success
===========================================

In both cases the X3D was reloaded from DOM from prior .x3d file.  Since they both have identical output methods, the problem must lie in how the DOM code is reading/parsing the input.

I fixed a little, but not everything.  More to follow as we keep zeroing in and stomping bugs.

Deployed an update that includes your just-sent latest nashorn .zip updates.



On 1/2/2018 9:48 AM, John Carlson wrote:
> Patch differences reduced. See patch and identical attachment.  This two files should have no differences.
> 
> John
> 
> diff HelloWorldProgramOutputOutput.x3d ../../examples/HelloWorldProgramOutput.x3d
> 
> 76c76
> 
> <                         <MetadataString name='quotesTestC' containerField='value' value='"MFString example C, backslash-escaped quotes: He said, \\"Immel did it!\\""'/>
> 
> ---
> 
>  >                         <MetadataString name='quotesTestC' containerField='value' value='"MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""'/>
> 
> 88c88
> 
> <                     <Text string='"One, Two, Three" "" "He said, \\"Immel did it!\\""'/>
> 
> ---
> 
>  >                     <Text string='"One, Two, Three" "" "He said, \"Immel did it!\""'/>
> 
> 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> -->
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Tuesday, January 2, 2018 12:15 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; x3d-public at web3d.org <mailto:x3d-public at web3d.org>
> *Subject: *RE: compare these two outputs. They should be identical.X3DJSAIL.
> 
> Here’s the patch differences.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Tuesday, January 2, 2018 12:09 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; x3d-public at web3d.org <mailto:x3d-public at web3d.org>
> *Subject: *compare these two outputs. They should be identical. X3DJSAIL.
> 
> Compare the output HelloWorldProgramOutput.x3d              (from HelloWorldProgram.java)
> 
>                                   to HelloWorldProgramOutputOutput.x3d (from HelloWorldProgramOutput.java)
> 
> HelloWorldProgramOutputOutput.x3d was generated like so:
> 
>                  <java classname="HelloWorldProgramOutput" classpath="${java.classes.dir};${java.jars.dir}/${jsai.full.archive.jar.name}" fork="${fork}">
> 
>                      <arg value="x3d"/>
> 
>                      <arg value="nashorn/examples/HelloWorldProgramOutputOutput.x3d"/>
> 
>                  </java>
> 
> These files should be identical. Why not? That’s the question I’ve been trying to answer, and I may have to patch X3DJSAIL myself…
> 
> 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