[x3d-public] JSON roundtrip validation results

Don Brutzman brutzman at nps.edu
Sun Mar 27 10:25:48 PDT 2016


On 3/26/2016 6:20 PM, John Carlson wrote:
> I was able to roundtrip JSON back to XML and compare the canonicalized original with the canonicalized round trip file using an XML -> JSON library for both XML files.  The comparison was done in JavaScript, so there may still be bugs.  The results are here.

>Of note, please search for “left file” to see things which weren’t included in the JSON file.  You can probably ignore the containerFields, I’ve been working on generating those from the X3D JSON Loader.  If you search for “right file” you will find the things I’ve added.  There are other differences to, and I need to work on comparing scripts.
>  http://coderextreme.net/diffresults.txt
>
> John

Looks super useful for dialing in your tool suite, great work John!

Looking at first entry:

/Users/johncarlson/Downloads/www.web3d.org/x3d/content/examples//Basic/AdditiveManufacturing/CleatClamp-roundtrip.x3d
############################################
diff /Users/johncarlson/Downloads/www.web3d.org/x3d/content/examples//Basic/AdditiveManufacturing/CleatClampCanonical.x3d /Users/johncarlson/Downloads/www.web3d.org/x3d/content/examples//Basic/AdditiveManufacturing/CleatClamp-roundtripCanonical.x3d
"0 0 0" is only in left file at /X3D/Scene/0/Transform/0/Transform/0/Transform/0/Transform/0/Transform/0/Group/0/Shape/0/Appearance/0/Material/0/$/emissiveColor
"0" is only in left file at /X3D/Scene/0/Transform/0/Transform/0/Transform/0/Transform/0/Transform/0/Group/0/Shape/0/Appearance/0/Material/0/$/transparency
"true" is only in left file at /X3D/Scene/0/Transform/0/Transform/0/Transform/0/Transform/0/Transform/0/Group/0/Shape/0/IndexedFaceSet/0/$/normalPerVertex
Different

Suggestions/possibilities:

a. put ############################################ where it separates file checks

b. wrapped file addresses aove are hard to compare, maybe start/indent each on a new line

c. all of the flagged values above are default values, so this test appears to be a false positive.

d. The example archives already include canonical versions as .xml files, these can be used for comparison or even testing.  This might help with your containerField alignment.

	http://www.web3d.org/x3d/content/examples//Basic/AdditiveManufacturing/CleatClampCanonical.xml

Quite possible your work will identify gaps in X3D Canonicalizer, am happy to pursue those also.

	https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/tools/canonical/

Curiously, am not seeing the dist/directory .jar for the X3D Canonicalizer in that SourceForge directory...  My local archive shows that it is checked in:

	https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/tools/canonical/dist/lib/X3dC14n.jar

Perhaps sourceforge blocks dist/ directories??

I will work on publishing X3D Canonicalizer to web3d.org, appears as if that was overlooked earlier.

Looking ahead: cleaning up containerField mismatches will certainly reduce the number of superfluous reports to ignore in your diff results.

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