[x3d-public] X3DJSSAIL: Configuration issues ? Clojure JSON output vs Java JSON output
John Carlson
yottzumm at gmail.com
Fri Jul 25 00:29:00 PDT 2025
I am writing this for anyone finding issues with Clojure JSON output using
X3DJSAIL, for example, some (JSON based) JavaScript code fails in Sunrize:
====================================================
" translation = new SFVec3f(\ttranslation.x + velocity.x, translation.y
+ velocity.y,
translation.z + velocity.z);",
" scale = new SFVec3f(scale.x + scalvel.x, scale.y + scalvel.y, scale.z
+ scalvel.z);",
" // if you get to far away or too big, explode",
" if ( Math.abs(translation.x) > 256) {",
"\ttranslation.x = 0;",
"\tinitialize();",
" }",
" if ( Math.abs(translation.y) > 256) {",
"\ttranslation.y = 0;",
"\tinitialize();",
" }",
" if ( Math.abs(translation.z) > 256) {",
"\ttranslation.z = 0;",
"\tinitialize();",
" }",
==========================================
Java JSON output is very nice!
==========================================
" translation = new SFVec3f(\ttranslation.x + velocity.x, translation.y
+ velocity.y, translation.z + velocity.z);",
" scale = new SFVec3f(scale.x + scalvel.x, scale.y + scalvel.y, scale.z
+ scalvel.z);",
" // if you get to far away or too big, explode",
" if ( Math.abs(translation.x) > 256) {",
"\ttranslation.x = 0;",
"\tinitialize();",
" }",
" if ( Math.abs(translation.y) > 256) {",
"\ttranslation.y = 0;",
"\tinitialize();",
" }",
" if ( Math.abs(translation.z) > 256) {",
"\ttranslation.z = 0;",
===================================================
Note the differences between > and >. Plus the added newlines for long
lines using the wrong stylesheet engine or with bad configuration?
I was able to fix the problem by adding the following code:
(org.web3d.x3d.jsail.ConfigurationProperties/setXsltEngine
org.web3d.x3d.jsail.ConfigurationProperties/XSLT_ENGINE_NATIVE_JAVA)
(org.web3d.x3d.jsail.ConfigurationProperties/setDeleteIntermediateFiles
false)
(org.web3d.x3d.jsail.ConfigurationProperties/setStripTrailingZeroes true)
(org.web3d.x3d.jsail.ConfigurationProperties/setStripDefaultAttributes true)
I'm assuming that there's something up with the setup of the Saxon
(default?) stylesheet engine.
I will try to get some example code out ASAP. Plus I want to migrate the
configuration to other X3DJSONLD Serializers.
I will also work on downloading a new X3DJSAIL after running some more
diagnostics.
! defaults don't work !
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250725/cdc801cf/attachment.html>
More information about the x3d-public
mailing list