Please choose between outputting a DEF before USEs for multiply referenced DEF nodes for HAnimSegment coord/children field Coordinate descendants and HAnimHumanoid's skin/skinCoord field Coordinate descendants, or maintain authors intent by keeping a list of MFNode/SFNode fields ordered by author's intent (keep a list). We can discuss on list if desired. Let me know if there's some other possible solution.
The reason I say multiply referenced DEF nodes is because any variable can be reused by addChild() , set*() in X3DJSAIL or a setter or append in X3DPSAIL, and it's kinder to handle this on output using the first technique, and I'm not sure if the second technique is viable without the first technique. Is the first technique viable? Ask Michalis K.
Michalis technique can also capture multiply referenced DEFs through traversal on output, and choose to output a USE node instead of a DEF node, or throw a warning.
There's a variety of options for implementation, but keeping the DEF value as a key in a HashMap seems doable, Options include boolean value, count value, node value or node list value in the HashMap. In Python, it would be a dict or object, I guess. One HashMap per namespace of course, so probably a HashMap keyed on namespace to a HashMap of DEF values (above) per namespace. I don't know how namespaces are managed in X3DJSAIL, but I'm guessing a context is needed to passed to each call (ala Lisp). I think SAI has that.
Potential fixes for fixing XML output (before stylesheets are invokrd):
https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%5B%221BXu0Kisposz09uPwE3BVWQBIGzD3IMUw%22%5D,%22action%22:%22open%22,%22userId%22:%22103290302001906699037%22,%22resourceKeys%22:%7B%7D%7D&usp=sharing
Use wisely, it's not a solution for XML output at all levels.
here's a skeleton implemenratiom
We spoke at great length about this on the mailing list. No one suggested
adding arbitrary AI code. This is an old ticket, suggesting a fix for
multiply referenced DEF nodes in Java. If you do want to pursue DEF
before USE and multiply referenced DEFs in the future, this design has been
extended. By a vote of 3 to 2, it was decided to support USE before DEF.
Multiply referenced DEFs are handled by adding DTD, Schema and Schematron,
when that gets put into X3DJSAIL validation.
Holger needs to handle author intent and list USE before DEF on output for
x3d-tidy, and perhaps Michalis needs to stop flagging USE before DEF in
Castle. I will file tickets.
John
On Fri, May 15, 2026 at 7:44 PM Don Brutzman brutzman@users.sourceforge.net
wrote:
Related
Tickets:
#102I do not understand what problem you are trying to solve. No test case provided.
We will not be adding arbitrary AI source code to X3DJSAIL, that is a security vulnerability and likely unmaintainable.
Better, simpler problem definitions please.
Last edit: Don Brutzman 2 days ago