<div dir="auto">Note that Saxon does not support dynamic maps, so I suggest that e.g.:  ‘’’new Group().setUSE(“DEF_value”)’’’ continue to be used for USE nodes Saxon-generated Java code.</div><div dir="auto"><br></div><div dir="auto">Does any see an issue with what Doug proposed supporting this requirement?</div><div dir="auto"><br></div><div dir="auto">The USE x3dnode will be converted into a x3dnode reference, and some x3dnodes will have multiple references pointing at them, per specification.  Also, programmers can reuse DEF/USE x3dnodes in the scenegraph.  I don’t know if non-DEF/USE x3dnodes can be reused.  That seems like an error.  Comments?</div><div dir="auto"><br></div><div dir="auto">On XML output from Java, the USE elements will be restored.</div><div dir="auto"><br></div><div dir="auto">Can anyone analyze Comment instances and containerFields for USE nodes?  This might be a reason to stay with a strict tree, and try for author intent or field order canonicalization.  Or alternatively, as Don is pursuing, optional USE before DEF everywhere.  I am not opposed to that, it just means updating Blender import, I believe.</div><div dir="auto"><br></div><div dir="auto">Probably some examples would be great.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 10:38 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Doug,</div><div dir="auto"><br></div><div dir="auto">I think it would work, yes.  The problem is getting the code into the X3DJSAIL stylesheet and getting a clean room solution, since I’ve been polluted by LLM code examples.</div><div dir="auto"><br></div><div dir="auto">I’m hoping Don or someone will step up to work on this.  Gotta turn the ship somehow.</div><div dir="auto"><br></div><div dir="auto">I can provide Java test cases. I’ve already provided one that orphans a DEF node.  This seems like the next logical step.  I’ve also provided JinOne that at one time, listed USE before DEF.</div><div dir="auto"><br></div><div dir="auto">The orphaned DEF node leads towards a solution, which means we will need the following:</div><div dir="auto"><br></div><div dir="auto">One follow-on test case will include a Java DAG.  There’s already an API for this using setUSE(node), but handling double+ add* and set* calls for same MFNode and SFNode parameters would be helpful, and there are tons of these.  These test cases were brought up a long time ago, in x3d.py work. Primarily, the focus will be outputting USE nodes to de-DAGify to XML.</div><div dir="auto"><br></div><div dir="auto">Then a double DEF.  This can throw an error, of course, or merely warn and replace one with USE.</div><div dir="auto"><br></div><div dir="auto">Are the requirements adequate?  Are people prepared to address these?</div><div dir="auto"><br></div><div dir="auto">The primary goal is to have a valid XML output from X3DJSAIL that will work with older technology.  Even help the Java programmer out a bit.  Not all Java code is generated by programs! ;) If the goal is to output invalid XML, you’re on your own!</div><div dir="auto"><br></div><div dir="auto">John</div><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 7:40 AM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Exporting</div><div>a) binary scene graph:</div>Lets say you start with a scene graph like a browser or editing tool would have internally, and the same node appears lets say twice in the scenegraph, and there's a name scope lookup table that holds (node address, string DEF name). And lets say you want to export, and your export function works in a single pass, in a serial branching manner, starting from the root node.<div>You could have a function writeNode(node) and a lookup table written (node address). The first time the node is encountered, writeNode() checks the written table, and if the node isn't listed, it adds it, and writes a full DEF. The second time the node is encountered, writeNode() finds it in the written list, and writes a USE.</div><div>b) weird graph with separate DEF and USE elements:</div><div>Now lets say you don't have a scene graph with binary nodes. Instead you have DEF and USE 'elements' / weird things --like x3d.py has.  Then what you suggest - an extra pass before exporting, to somehow consolidate the DEF and USE so they refer to a single thing, would help. On the  pre-pass, starting with a blank lookup table per nane scope written( DEF name, node), writeNode() could add  (DEF name, DEF element address, bool written = false) when it finds a full DEF, but not write anything out. Then on the second pass, when it hits a USE or DEF, it checks the written table with the DEF/USE name to get the full DEF element. If it hasn't been written yet (written flag false), writeNode() writes the element as a full DEF element, sets the written flag to true. If it has been written --written flag true-- it writes a USE element.</div><div>Would that work for X3DJSAIL?</div><div>-Doug</div></div><br><div class="gmail_quote"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 1, 2026 at 11:03 PM John Carlson via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">There are 2 distinct problems:  the Java input problem (mine) and the XML input problem (Don).  Solving the XML input problem doesn’t solve the Java input problem.<div dir="auto"><br></div><div dir="auto">My requirements:<div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple paths to a DEF x3dnode in a directed acyclic graph.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple DEF x3dnodes with same value and combine attributes, and replace second or further DEF x3dnodes with a USE xmlnode on output.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, only have an  DEF attribute value for the first of xmlnodes with same DEF/USE value.  The remaining x3dnodes with the same DEF/USE will have a USE value, and potentially a containerField value different from DEF and USE x3dnodes with the same DEF/USE value.   THE USE nodes will have a name attribute value where required.</div><div dir="auto"><br></div><div dir="auto">It appears that to meet these requirements a second pass on output will be required.   I believe the only way to avoid this is to only have one x3dnode for each DEF/USE value.  We could make that a requirement of X3DJSAIL users, but I haven’t seen any traction on that.</div><div dir="auto"><br></div><div dir="auto">It might be required that a second pass on input if USE is before DEF, especially if USE is before DEF.   We can’t avoid USE before DEF on output without a second pass.  Field order canonicalization and author intent are non-starters.</div><div dir="auto"><br></div><div dir="auto">So it appears like we need 3 passes, an input pass, a common DEF/USE x3dnode discovery pass, and an output pass.  I would prefer to put the discovery pass after the scene is built, because who knows what a Java developer is going to put together.</div><div dir="auto"><span><br></span></div><div dir="auto"><span>Thanks for reading,</span><br></div><div dir="auto"><span><br></span></div><div dir="auto"><span>John </span></div></div></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>