<div dir="ltr"><div dir="ltr"><div>I'm not seeing any problems with X3D specification or browser implementations if USE references are allowed to precede DEF instances.</div><div><br></div><div>1. Single-pass parsing is historic approach for X3D/VRML and what already exists.</div><div><br></div><div>2. "Two-pass" parsing is straightforward: for creating the ID tables,</div><div>a. first pass builds list of all DEF nodes as they occur, also builds list of names for all USE and ROUTE references as they occur.  ProtoDeclare entries get namespace prefix for independence.</div><div>b. once complete, entries in second list are simply updated to include the relevant DEF references.  please note that this doesn't actually require a second pass through the scene, merely an loop to correlate to second USE list with the first DEF list.</div><div><br></div><div>This browser approach is a miniscule performance requirement (and quite possibly simpler) than single-pass parsing algorithms in current use.</div><div><br></div><div>Summary for this issue is maintained at</div><div><ul><li> Mantis 1526, relaxing requirement for DEF node declaration prior to USE or ROUTE references</li><li><a href="https://mantis.web3d.org/view.php?id=1526">https://mantis.web3d.org/view.php?id=1526</a></li></ul></div><div>Further discussion:</div><div><br></div><div>ROUTEs are parsed in order, with handling of their fromNode/toNode references handled similarly to USE references.  Some browsers have put them all at the end of the scene graph, which does not alter any ROUTE logic if maintained in order.  If ROUTE loops might exist, they are handled at run time by the "loop-breaking mechanism" which forbids the same event going down a ROUTE connection twice in one rendering frame.  This has always been an impressive feature of VRML and X3D, preventing infinite loops... the spec sayeth:</div><div><ul><li>X3D Architecture draft v4.1, clause 4 Concepts, 4.4.8.4 Loops</li><li><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#Loops">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#Loops</a></li></ul><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b>4.4.8.4 Loops</b><br>Event cascades may contain <i>loops</i> where an event <i>E</i> is routed to a node that generates an event that eventually results in <i>E</i> being generated again. See <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#ExecutionModel">4.4.8.3 Execution model</a>, for the loop breaking rule that limits each event to one event per timestamp. This rule shall also be used to break loops created by cyclic dependencies between different sensor nodes.</blockquote></div></div><div><br></div><div>Of course authors are encouraged not to create ROUTE loops, although they are possible.</div><div><br></div><div>Of note: building X3D HTML Documentation pages from an .x3d model will report the existence of such loops if they occur within a certain depth (8 ROUTEs is the maximum depth of inspection I think, avoiding infinite loops).  This helps authors.  Here is a model that includes three separate ROUTE loops each occurring at depth 4.</div><div><ul><li><a href="https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50bodyIndex.html">Savage X3D Examples Archive, Ships Military, Patrol Craft Naval Academy Brazil, Mtr 50body</a></li><li><a href="https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50bodyIndex.html">https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50bodyIndex.html</a></li><li><a href="https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50body.html">https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50body.html</a> (X3D model documentation)</li><li><a href="https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50body.html#EventGraph">https://www.web3d.org/x3d/content/examples/Savage/ShipsMilitary/PatrolCraftNavalAcademyBrazil/Mtr50body.html#EventGraph</a></li></ul><div>for example</div></div><div><img src="cid:ii_mondowsw0" alt="image.png" width="562" height="273"><br></div><div><br></div><div>Have fun with X3D DEF, USE, ROUTE, and animation event passing!  😁 👉</div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34)"><font face="monospace"><br></font></div><div style="color:rgb(34,34,34)"><font face="monospace">all the best, Don</font></div><div style="color:rgb(34,34,34)"><font face="monospace">-- </font></div><div style="color:rgb(34,34,34)"><font face="monospace">X3D Graphics, Maritime Robotics, Distributed Simulation</font></div><div style="color:rgb(34,34,34)"><font face="monospace">Relative Motion Consulting  <a href="https://RelativeMotion.info" target="_blank">https://RelativeMotion.info</a></font></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, May 1, 2026 at 7:31 AM GPU Group <<a href="mailto:gpugroup@gmail.com">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">"

not received any negative technical feedback" <div>The methods I can think of for resolving USE before DEF:</div><div>a) single-pass parsing with proxies</div><div>b) multi-pass parsing</div><div>Both have technical issues. </div><div>a) single-pass parsing with proxies</div><div>- routes would need to carry proxy (node name, field name) tuple until DEF defined, like routing to an Inline IMPORT node</div><div>complexities:?  errors -invalid field name, mis-matched field type, no DEF in name scope- wouldn't show up till scene run-time, making tracing errors difficult. Proxy would/could hold the source file line number for tracing to source file, but this would imply multiple USE proxies refering to same DEF, in order to hold a source file line number for each USE. 'compiling' routes on the fly - first time ROUTE is run/fired, and DEF and field pointers found successfully, a flag could be set saying the ROUTE is compiled, and so the (node name, field name) tuple can be ignored/discarded thereafter, until Inline unloaded, Since there's no direct way for a ROUTE to know when an Inline is unloaded, routes would need to recompile on every fire/run - re-testing if the node exists, and if the node exists, but address has changed (Inline unload and reload), then the absolute field address also changes. If proxy refers to a builtin node type, the relative address from node address would remain the same. But what if the node is a ProtoInstance, and Inline url changed, so a different ProtoDeclare with same Instance DEF name inside the Inline but different field order? Then relative field address would/could also change. So in general ROUTES would never compile -- always looking up field by character string name. -- unless an algorithm to cover all cases is developed.</div><div>b) multi-pass parsing</div><div>- 1st pass: parse ProtoDeclares</div><div>- multiple passes: parse DEF nodes: would need to note the name scope (scene or protobody) to go with the DEF (name scope, DEF name, parsed DEF node) </div><div>- the parsed DEF node could be complex with fields referring to other USE before DEF, or ProtoInstances, so ProtoDeclares would need to be parsed first, and they would also be per-name-scope. Could there be USE loops, where multiple passes never resolve?</div><div>-Doug</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2026 at 11:38 PM Don Brutzman via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Good observation.  Prior definition of DEF values should not matter to ROUTEs either.</div><div><br></div><div>This is a recent change that has not received any negative technical feedback.  Browser support is still catching up.</div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34)"><font face="monospace"><br></font></div><div style="color:rgb(34,34,34)"><font face="monospace">all the best, Don</font></div><div style="color:rgb(34,34,34)"><font face="monospace">-- </font></div><div style="color:rgb(34,34,34)"><font face="monospace">X3D Graphics, Maritime Robotics, Distributed Simulation</font></div><div style="color:rgb(34,34,34)"><font face="monospace">Relative Motion Consulting  <a href="https://RelativeMotion.info" target="_blank">https://RelativeMotion.info</a></font></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2026 at 9:41 PM Joe D Williams <<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12pt"><p style="margin:0.1rem 0px;line-height:1">From description:</p>
<p style="margin:0.1rem 0px;line-height:1">> <span style="font-size:12pt">Note that the actual DEF node name definition</span></p>

<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0px;line-height:1">Followed by:</p>
<p style="margin:0.1rem 0px;line-height:1">> <span style="color:rgb(0,0,0);font-family:univers,arial,sans-serif;font-size:medium;white-space:normal;background-color:rgb(255,255,0);float:none;display:inline">NOTE   DEF names are not required to precede USE references.</span> </p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0px;line-height:1">(in the User Code)? </p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0px;line-height:1">Wondering if this rule is any different than for ROUTE connections?</p>
<p style="margin:0.1rem 0px;line-height:1">Timers and interpolators must appear before Route can reference them. </p>
<p style="margin:0.1rem 0px;line-height:1">proto definitions before instances. Same for DEF/USE, lthe DEF must appear first or else What gets put in?</p>
<p style="margin:0.1rem 0px;line-height:1">So, I don't understand that last note. </p>
<p style="margin:0.1rem 0px;line-height:1">Thanks,</p>
<p style="margin:0.1rem 0px;line-height:1">Joe</p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0px;line-height:1"> </p>

<div style="border-left:1px solid rgb(170,170,170);box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px">
<p style="line-height:1">-----Original Message-----<br>From: Don Brutzman <<a href="mailto:don.brutzman@gmail.com" target="_blank">don.brutzman@gmail.com</a>><br>Sent: Apr 30, 2026 11:05 AM<br>To: Extensible 3D (X3D) Graphics public discussion <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>Cc: Joe D Williams <<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>>, John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>Subject: Re: [x3d-public] X3DJSAIL: Many DEFs with same value</p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<div dir="ltr">
<div>Multiple duplicate DEF names in a single X3D model is a bad practice, for multiple reasons.</div>
<div> </div>
<div>I've updated Scene Authoring Hints accordingly, see highlighted text which follows plus additional references.  Hope this helps.</div>
<div>
<ul>
<li>X3D Scene Authoring Hints: Naming Conventions</li>
<li><a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions</a></li>
</ul>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<h3 style="color:rgb(0,0,0);font-family:"Times New Roman""><span style="font-size:small"><a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions" target="_blank">🔖</a> <u><a id="m_2347367789694977122m_-301687211207906899m_3408339107120132057gmail-NamingConventions"></a>Naming Conventions</u></span></h3>
<p style="color:rgb(0,0,0);font-family:"Times New Roman";line-height:1">Models are simple representations for some part of reality. Simulations show the behavior of models over time.</p>
<ol style="color:rgb(0,0,0);font-family:"Times New Roman"" type="a">
<li>Clarity is essential when naming components to design a meaningful model.</li>
<li>Names matter, suggesting how to think about purpose and relationships.</li>
<li>These naming conventions are suitable for X3D scenes, XML tagset design, accompanying HTML pages, and corresponding source code written JavaScript/Java/Python/etc.</li>
<li>These naming conventions also match the node and field naming conventions found in the <a href="https://www.web3d.org/x3d/progress" target="_blank">X3D Standards</a> themselves (and elsewhere).</li>
<li>Success Metric: when is a name successful?<br>(Ironic) Answer: when no one has to discuss that name any more, it is simply understood.</li>
</ol>
<p style="color:rgb(0,0,0);font-family:"Times New Roman";line-height:1">Naming conventions are appropriate for file names, DEF node identifiers and USE node references, prototype names, unique IDs, and more.</p>
<p style="color:rgb(0,0,0);font-family:"Times New Roman";line-height:1">Here is a combined set of guidelines.</p>
<ol style="color:rgb(0,0,0);font-family:"Times New Roman"">
<li>Using clear and consistent names for node names and DEF labels greatly improves the clarity of how a scene works.</li>
<li>In effect, descriptive names can make the purpose and mechanics of a scene self-documenting.</li>
<li><span style="background-color:rgb(255,242,204)">Avoid <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#DuplicateDEF" target="_blank">duplicate DEF</a> identifier naming as a bad practice</span>, even when identical names might seem reasonable when declaring a prototype in a model. The resulting model will fail XML validation, fail semantic query, and not make sense due to unclear definitions.  Bookmarks in X3D Documentation pages will also fail since duplicate paragraph anchors will be present.</li>
</ol>
</blockquote>
<div><span style="color:rgb(0,0,0);font-family:"Times New Roman"">[...]</span></div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><a style="font-family:"Times New Roman";font-size:medium" href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#ProtoDeclare" target="_blank">🔖</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> </span><strong style="color:rgb(0,0,0);font-family:"Times New Roman""><a id="m_2347367789694977122m_-301687211207906899m_3408339107120132057gmail-ProtoDeclare"></a>Prototype Declarations</strong><span style="color:rgb(0,0,0);font-family:"Times New Roman""> define a template for a new node</span>
<ul style="color:rgb(0,0,0);font-family:"Times New Roman"">
<li>Follow <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#NamingConventions" target="_blank">Naming Conventions</a> for node and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#field" target="_blank">field</a> definitions.</li>
<li>Provide useful/safe default initialization values for each field, rather than depending on default field values internal to the <code>ProtoBody</code>.</li>
<li>Include annotation tooltips for each field.</li>
<li>Avoid copying <code>ProtoDeclare</code> definitions into additional scenes, instead copy <code>ExternProtoDeclare</code>/<code>ProtoInstance</code> definitions.</li>
<li>Tooltips for <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#ProtoDeclare" target="_blank"><code>ProtoDeclare</code></a>, <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#ProtoInterface" target="_blank"><code>ProtoInterface</code></a> and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#ProtoBody" target="_blank"><code>ProtoBody</code></a></li>
<li><a id="m_2347367789694977122m_-301687211207906899m_3408339107120132057gmail-DuplicateDEF"></a>Avoid <span style="background-color:rgb(255,242,204)">duplicate DEF names </span>for nodes inside multiple prototype declarations contained in a single file. Although the DEF namespaces contained inside each independent ProtoBody declaration are logically independent from an X3D perspective, duplicate DEF names will provoke XML validation errors regarding duplicate ID names. They can also easily lead to author confusion, providing semantic ambiguity both notionally and if performing Semantic Web Queries in Turtle.</li>
<li>X3D Specification clause: <a href="https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#PrototypeSemantics" target="_blank">Prototype Semantic</a></li>
</ul>
</blockquote>
<div>Further discussion can also be found in</div>
<div>
<ul>
<li><em><a href="https://x3dgraphics.com/" target="_blank">X3D: Extensible 3D Graphics for Web Authors</a>,</em> Don Brutzman and Leonard Daly, Morgan Kaufmann Publishers, Elsevier, 2007</li>
<li><a href="https://x3dgraphics.com" target="_blank">https://x3dgraphics.com</a></li>
<li>Chapter 3 Grouping Nodes, 2. Concepts, 1.4 DEF and USE (pp 71-72)</li>
</ul>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2.4. DEF and USE<br>DEF and USE names are the X3D mechanism for efficiently defining and copying a<br>node, multiple nodes, or even groups of nodes. Copied nodes require far less memory<br>and computation because they need only be created once. This efficiency can greatly<br>improve rendering performance when extensively used in large scenes.<br>When a node is given a DEF name, that name is an identification label that is unique<br>in the file. The DEF name must start with a letter and can contain letters, numbers, and<br>the special characters underscore, hyphen, and period. DEF names must not include<br>whitespace or other special characters. Uppercase and lowercase alphabetic characters<br>are considered strictly different; therefore, DEF names are case sensitive.<br>USE names refer back to a node with a DEF name. These references allow faster and<br>more efficient rendering of graphics objects. Note that the actual DEF node name definition<br>must be located in the scene graph before any USE references. This permits X3D<br>browsers to read and load a scene graph in a single pass, avoiding undefined references<br>and thereby yielding faster parsing and loading. This performance boost not only helps<br>when users first load a scene, but is also valuable when further subscenes are loaded<br>within a parent scene. Authors also must be careful with animation of the fields of a DEF<br>node, because this will equally affect all of the USE copies.<br>When authoring large scenes, using descriptive DEF names improves clarity and<br>helps document a model. CamelCaseNaming is a good way to accomplish this: capitalize<br>each word, never use abbreviations, strive for clarity, and be brief but complete.<br>Avoiding underscore characters improves readability, because pretty-print HTML versions<br>of scenes usually hyperlink these names, and underlined hyperlinks hide</blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> underscore characters from the user. ROUTE statements that connect one node’s field to</blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">another node’s field are much more understandable when the purpose and type of the<br>node are evident in the DEF names themselves. Examples provided with this book strive<br>to provide useful examples of good naming practices. ROUTE connections are covered<br>in Chapter 7, Event Animation and Interpolation.<br>A good rule of thumb is that a proper DEF name can be sensibly used in a sentence.<br>For example, “The fraction_changed field of the SpinningBoxClock TimeSensor node<br>is ROUTED to the set_fraction field of the SpinningBoxInterpolator node.” Although<br>a bit long winded, such sentences provide a clear and sensible explanation for a given<br>behavior.</blockquote>
</div>
<div> </div>
<div>Authoritative reference is always X3D Architecture.</div>
<div>
<ul>
<li>X3D Architecture v4.1 draft, clause 4 Concepts, 4.4.3 DEF/USE semantics</li>
<li><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#DEF_USE_Semantics" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#DEF_USE_Semantics</a></li>
</ul>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<h2 style="margin-top:18px;color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif"><span style="background-color:yellow" title="Mantis 1526"><span style="font-size:small">4.4.3 DEF/USE semantics</span></span></h2>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;line-height:1">Node DEF names are limited in scope to a single X3D file, prototype definition, or string submitted to either CreateX3DFromString, CreateX3DFromStream, or CreateX3DFromURL X3D browser service (as specified in <a href="https://www.web3d.org/specifications/X3Dv4Draft/references.html#I19775_2" target="_blank">ISO/IEC 19775-2</a>).</p>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;line-height:1">The USE statement does not create a copy of the node identified by a DEF name. Instead, the same node is inserted into the scene graph a second time, resulting in the node having multiple parents (see <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#TransformationHierarchy" target="_blank">4.3.5 Transformation hierarchy</a>, for restrictions on self-referential nodes).</p>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;line-height:1">Node names shall be unique in the context within which the associated DEF name occurs. <span style="background-color:yellow" title="editorial, Mantis 1526">Any USE node reference without a corresponding DEF, within the scope of the current scene or prototype declaration, is an error.</span></p>
<p style="margin-top:18px;margin-bottom:18px;font-family:univers,arial,sans-serif;color:rgb(0,0,0);line-height:1"><span style="background-color:yellow" title="ensure consistent implementations, Mantis 1526">NOTE   DEF names are not required to precede USE references.</span></p>
</blockquote>
</div>
<div>Have fun building understandable models with X3D!  😁 👍</div>
<div><span style="font-family:monospace"> </span></div>
<div><span style="font-family:monospace">all the best, Don</span></div>
</div>
<div>
<div class="gmail_signature" dir="ltr">
<div dir="ltr">
<div style="color:rgb(34,34,34)"><span style="font-family:monospace">-- </span></div>
<div style="color:rgb(34,34,34)"><span style="font-family:monospace">X3D Graphics, Maritime Robotics, Distributed Simulation</span></div>
<div style="color:rgb(34,34,34)"><span style="font-family:monospace">Relative Motion Consulting  <a href="https://RelativeMotion.info" rel="noopener" target="_blank">https://RelativeMotion.info</a></span></div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Thu, Apr 30, 2026 at 3:25 AM John Carlson via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto" style="font-size:inherit">Summary: to employ multiple DEFs with same value, employ a table per name scope of DEF information in per Java thread java.lang.ThreadLocal memory for encoded output with one DEF per DEF/USE value.  See bolded table description below.</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">Feel free to forward.</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">Is many DEFs with same value for<span style="font-size:inherit"> a scenegraph node being considered in discussions?  Say I want to addChild() the same Shape node several times to different Transforms</span><span style="font-size:inherit">, and the Shape node or descendants have DEFs in them.  In X3DJ</span><span style="font-size:inherit">SAIL, of course.   </span><span style="font-size:inherit">This is easily done in an SAI binding like X3DJSAIL, just use the same variable passed to several addChild() methods.</span></div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">If it is allowed, what comes out in XML?  I am hoping one leading DEF and several USEs for backwards compatibility.  I think Castle has shown that this is doable.</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">I am not saying VRML, XML, DOM, or HTML should have multiple parents of a child node. If a browser wants to implement a proxy when a DEF/USE appears more than once, they should be free to do that.  (Hint: JavaScript’s Proxy class.) Maybe each mention of a DEF value (second or following) or USE value (any natural number of them) should create a Proxy on setting or adding?</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">I do think the encodings are doing the right thing, no changes there.  How can we achieve that output and support multiple parents (references or proxies to children) in X3DJSAIL with one DEF node per DEF value <span style="font-size:inherit">output?</span></div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">I’m particularly wondering for X3DJSAIL.</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">Do we need proxies, or will table(s) also solve the issue of multiple DEFs, and replace all but the first with USE on output<span style="font-size:inherit">?  Also perhaps assuming there’s a DEF table per name scope.  How does X3DJSAIL support name scopes? (I’m clueless, currently).  <strong>I’m imagining a table with DEF_value, DEF_found, reference_count, DEF_nodes and USE_nodes columns.  Maybe a name_scope and node_type_name as well.</strong>  These table(s) would be initialized when output begins potentially when a name scope is entered, and filled out as the XML is created.   Multiple threads?  The table can be stored in ThreadLocal memory.  Bingo, if it’s still a thing.</span></div>
<div dir="auto" style="font-size:inherit"><span style="font-size:inherit"> </span></div>
<div dir="auto" style="font-size:inherit"><span style="font-size:inherit">Please let me know if such a thing is already available.</span></div>
<div dir="auto" style="font-size:inherit"><span style="font-size:inherit"> </span></div>
<div dir="auto" style="font-size:inherit"><span style="font-size:inherit">Someone else can solve for X3DPSAIL?</span></div>
<div dir="auto" style="font-size:inherit"><span style="font-size:inherit"> </span></div>
<div dir="auto" style="font-size:inherit">Will this also handle USE before DEF?</div>
<div dir="auto" style="font-size:inherit"> </div>
<div dir="auto" style="font-size:inherit">John</div>
_______________________________________________<br>x3d-public mailing list<br><a href="mailto:x3d-public@web3d.org" rel="noopener" target="_blank">x3d-public@web3d.org</a><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noopener noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></blockquote>
</div>
</div>

<p style="margin:0.1rem 0px;line-height:1"> </p></div>must be located in the scene graph before any USE references.</blockquote></div>
_______________________________________________<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>