[x3d-public] Getting JSON that works, Canonical JSON
Don Brutzman
don.brutzman at gmail.com
Fri Mar 27 08:47:01 PDT 2026
Please keep things simple. An X3D model is either valid or not.
An X3D JSON model has limited validation capabilities on its own, namely
jsonlint to confirm that it is well formed.
An excellent test of any converters is whether round-trip conversion is
possible. If information is lost or incorrectly structured, then that
round-trip test reveals that something somewhere didn't work. Further
sleuthing and corrections are then appropriate for further work.
When XML encoding is part of round-trip testing, then immense set of
quality assurance diagnostics are available.
Exceedingly long conversion chains might reveal a difficulty, but they are
often confusing and unhelpful for precise debugging and correction.
Recommend working on small examples, one at a time. That way any
conversion flaws can be fixed, one at a time. Step by step.
all the best, Don
--
X3D Graphics, Maritime Robotics, Distributed Simulation
Relative Motion Consulting https://RelativeMotion.info
On Fri, Mar 27, 2026 at 8:20 AM John Carlson via x3d-public <
x3d-public at web3d.org> wrote:
> To be clear:
>
> .x3d->x3d-tidy->.x3dj->X3DJSONLD->DOM->Serializer->Java,
> etc.->X3DJSAIL/stylesheets->XML, JSON, (more?) probably won’t work in many
> cases, due to DEF/USE reordering within SFNode field reordering. I am not
> saying the .x3dj files are bad files.
>
> x3d->X3dToJson.xslt->.json->X3DJSONLD->DOM->Serializer->Java, etc.->X3DJSAIL/stylesheets->XML,
> JSON, (more?) probably will work.
>
> Using Canonical form might solve this issue. But what is canonical JSON?
>
> Specific ordering issues that that have come up include head statements,
> HAnimHumanoid and HAnimSegment nodes.
>
> Please try to ensure that the authors ordering is preserved, or use
> canonical form.
>
> Note that X3DJSONLD *should* act like a pass through. But further work to
> achieve canonical form may be desired.
>
> X3DJSAIL/stylesheets should stick with canonical form, if it uses it, but
> warn of potential DEF/USE reordering, if it can’t handle DEF/USE reordering
> under canonicalization.
>
> x3d-tidy should also stick with canonical form, or not modify canonical
> form or alternatively, author’s intent.
>
> Does this seem reasonable?
>
> John
>
>> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20260327/55be8d16/attachment.html>
More information about the x3d-public
mailing list