<div dir="auto">What’s going on is that Holger’s x3d-tidy is reordering fields, and handing DEF/USE properly, but X3DJSAIL’s field ordering is fixed.    I personally don’t know how to fix X3DJSAIL, unless it can handle DEF/USE node reordering like x3d-tidy.</div><div dir="auto"><br></div><div dir="auto">So really, the onus is on X3DJSAIL to output DEF/USE properly.  Perhaps through a technique, stylesheet or process that reorders DEF/USE nodes properly, canonicalization, etc.</div><div dir="auto"><br></div><div dir="auto">Hence recent efforts to redefine DEF/USE in the standard.</div><div dir="auto"><br></div><div dir="auto">The real answer is to handle X3D like a direct acyclic graph, instead of a tree.  This is a post process to XML loading into DOM in X3DJSAIL<span style="font-family:-apple-system,sans-serif">, and has everything to do with scenegraph loading and proper XML output of the scenegraph.</span></div><div dir="auto"><br></div><div dir="auto">Nice work, Holger, bringing this to a head.</div><div dir="auto"><br></div><div dir="auto">Maybe this is why X3DPSAIL doesn’t load XML.</div><div dir="auto"><br></div><div dir="auto">Since X3DJSONLD doesn’t load a scenegraph, I’ve skirted this issue.  Which scenegraph should I use?</div><div dir="auto"><br></div><div dir="auto">John <br><div class="gmail_quote gmail_quote_container" dir="auto"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">John Carlson</strong> <span dir="auto"><<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>></span><br>Date: Fri, Mar 27, 2026 at 10:19 AM<br>Subject: Getting JSON that works, Canonical JSON<br>To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br></div><br><br><div dir="auto">To be clear:</div><div dir="auto"><br></div><div dir="auto">.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.</div><div dir="auto"><br></div><div><div style="font-size:inherit" dir="auto"><span style="color:rgb(0,0,0);font-family:-apple-system,sans-serif;font-size:inherit;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">x3d->X3dToJson.xslt->.json->X3DJSONLD->DOM->Serializer->Java, etc.->X</span><span style="font-family:-apple-system,sans-serif;font-size:inherit">3DJSAIL/stylesheets->XML, JSON, (more?) probably will work.</span></div><div style="font-size:inherit" dir="auto"><span style="font-family:-apple-system,sans-serif;font-size:inherit"><br></span></div><div style="font-size:inherit" dir="auto">Using Canonical form might solve this issue.  But what is canonical JSON?</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Specific ordering issues that that have come up include head statements, HAnimHumanoid and HAnimSegment nodes.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Please try to ensure that the authors ordering is preserved, or use canonical form.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Note that X3DJSONLD *should* act like a pass through.  But further work to achieve canonical form may be desired.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">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.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">x3d-tidy should also stick with canonical form, or not modify canonical form or alternatively, author’s intent.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Does this seem reasonable?</div></div><div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto"><span style="font-size:inherit;font-family:-apple-system,sans-serif">John</span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>
</div></div>