[x3d-public] X3DJSAIL -- java.Core.X3DObject.toFileJSON() produces extra newlinesin JSON file.

yottzumm at gmail.com yottzumm at gmail.com
Fri Jan 27 18:07:42 PST 2017


I just realized it could be a difference between saon9he.jar and saxon9B.jar.  Will try that tomorrow.

John

Sent from Mail for Windows 10

From: yottzumm at gmail.com
Sent: Friday, January 27, 2017 8:58 PM
To: Don Brutzman; Roy Walmsley; x3d-public at web3d.org
Subject: X3DJSAIL -- java.Core.X3DObject.toFileJSON() produces extra newlinesin JSON file.

Here is the result.json (moved to from JSON.json) produced from newScene.java, and the newScene.json which newScene.java is derived from.  Note that newScene.java is missing 3 metaObjects from newScene.json, removed by X3DJSONLD, which is placed back into result.json by X3dToJson.xslt.  I think perhaps some parameter names and values are missing from calling the X3dToJson.xslt stylesheet in X3DObject.toFileJSON(), because there’s no indentation in result.json.  Also, there are extra newlines in the result.json file, which I believe make it illegal JSON (but I’m not sure).  The head’s children got moved around as well—Would a more declarative style in Java help?  Is this handling of comments (actually children) a breaker for the JSON encoding or perhaps just the SAI exports?

I can’t figure out where the newlines are coming from without looking deep into the stylesheet or Java code.  They seem to be coming at the first blank spot after the 80th character, but I’m not sure.  I’m suspecting some kind of filter.

Is there a better way to configure the stylesheet through Java?   I will look for documentation next.  Can we configure it to be the same as the X3D -> JSON conversion found in the X3D Resources Examples JSON build?  Or do we want something smaller?

Thanks!

John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170127/d99eb7fe/attachment.html>


More information about the x3d-public mailing list