<div dir="ltr">The change -to un-ordered DEF and USE- would break old/current/<4.0 freewrl parsing. Freewrl uses MFNode / children lists holding only 64bit node addresses.<div>The concept of proxies --used/mentioned (by X_ITE?) for programming against unloaded/future-loaded Inline content-- in theory could be extended in a new/future/4.1+ freewrl version so all nodes are wrapped by a(n initially empty) proxy that's DEF/USE associated. Then programming -routing, scripting declarations- can be done against the (possibly empty) proxies early in scope of a one-pass parser, and DEFed / allocated specific node content later in the scope, before the scene starts to run. Runtime code could check for empty proxies --which may occur for other reasons such as when a Script deletes a node, there's a 'clean up' of all routing and other script references, and simply leaving the small proxy in place with a deletion/empty flag could avoid crashes.<div>Not sure about old scenes that assume a second (same) DEF name in same scope would produce a new (DEF name, node) tuple for later scene lookups, haven't thought about that.</div><div>-Doug<br><div><br></div></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2026 at 6:16 PM Don Brutzman via x3d-public <<a href="mailto:x3d-public@web3d.org">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>BLUF: review and comment welcome, especially by browser implementers.</div><div><br></div><div>"Way back in the day" there was a requirement for DEF labels to precede USE references.  This was for best performance of scene loading, to permit single-pass construction of a scene graph, without having to make a second pass that replaced dangling USE references back to a DEF table (which was constructed during the first pass).  This was a VRML97-era requirement.</div><div><br></div><div>Such a requirement hardly seems necessary with modern parsing and processing.  There is not such a requirement in HTML or any other XML languages that I have encountered.</div><div><br></div><div>Dick Puk and I have looked at this pretty closely.  Now proposed and written up in the Mantis issue tracker:</div><div><ul><li><a href="https://mantis.web3d.org/view.php?id=1526" target="_blank">Mantis 1526: relaxing requirement for DEF prior to USE - Web3D MantisBT</a></li><li><a href="https://mantis.web3d.org/view.php?id=1526" target="_blank">https://mantis.web3d.org/view.php?id=1526</a></li></ul><div><table style="font-family:Poppins;border-collapse:collapse;border-spacing:0px;width:1023.37px;max-width:100%;margin-bottom:0px;border-width:0px;border-style:solid;border-color:rgb(229,229,229) rgb(221,221,221) rgb(221,221,221);color:rgb(57,57,57);font-size:13px;border-radius:0px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><th style="box-sizing:border-box;padding:5px;text-align:left;color:rgb(0,0,0);vertical-align:top;line-height:1.42857;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px;background-color:rgb(237,243,244)">Description</th><td colspan="5" style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px">Historically defining a DEF name has been required prior referencing it via corresponding USE name.<br style="box-sizing:border-box"><br style="box-sizing:border-box">Original rationale was based on allowing single-pass parsing of text-formatted files, in order to maximize parsing performance and minimize parsing memory requirements. Occasionally this requirement was reaffirmed over the years.<br style="box-sizing:border-box"><br style="box-sizing:border-box">Modern systems (including hand-held devices) have much greater memory capacity and computational power. Further, modern parsing libraries are more efficient. This requirement is fairly unique to X3D/VRML and not a common prerequisite in other declarative languages based on XML or JSON.<br style="box-sizing:border-box"><br style="box-sizing:border-box">Can the requirement for DEF before USE be relaxed for X3D 4.1?<br style="box-sizing:border-box"><br style="box-sizing:border-box">At a minimum, the specification needs to point out that putting DEF prior to corresponding USE permits single-pass parsing with higher performance and possible lower memory requirements.<br style="box-sizing:border-box"><br style="box-sizing:border-box">Also, at a minimum, since it is a historical requirement, the specification ought to explicitly state whether such ordering is required or not.</td></tr><tr style="box-sizing:border-box"><th style="box-sizing:border-box;padding:5px;text-align:left;color:rgb(0,0,0);vertical-align:top;line-height:1.42857;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px;background-color:rgb(237,243,244)">Additional Information</th><td colspan="5" style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px">Where is this requirement? Not found in the following:<br style="box-sizing:border-box"><br style="box-sizing:border-box">* 4.4.3 DEF/USE semantics<br style="box-sizing:border-box">* <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html" rel="noopener" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html</a><br style="box-sizing:border-box">"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 ISO/IEC 19775-2).<br style="box-sizing:border-box"><br style="box-sizing:border-box">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 4.3.5 Transformation hierarchy, for restrictions on self-referential nodes)."<br style="box-sizing:border-box"><br style="box-sizing:border-box">Node names shall be unique in the context within which the associated DEF name occurs. 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 ISO/IEC 19775-2).<br style="box-sizing:border-box"><br style="box-sizing:border-box">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 4.3.5 Transformation hierarchy, for restrictions on self-referential nodes).<br style="box-sizing:border-box"><br style="box-sizing:border-box">Node names shall be unique in the context within which the associated DEF name occurs."</td></tr></tbody></table><table style="font-family:Poppins;border-collapse:collapse;border-spacing:0px;width:1023.37px;max-width:100%;margin-bottom:0px;border-width:0px;border-style:solid;border-color:rgb(229,229,229) rgb(221,221,221) rgb(221,221,221);color:rgb(57,57,57);font-size:13px;border-radius:0px"><tbody style="box-sizing:border-box"><tr id="m_-2123966226880762249gmail-c3879" style="box-sizing:border-box;background-color:rgb(249,249,249)"><td style="box-sizing:border-box;padding:5px;color:rgb(0,0,0);font-weight:bold;vertical-align:top;line-height:1.42857;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px;background-color:rgb(237,243,244)"><div style="box-sizing:border-box;float:left;padding:2px"></div><div style="box-sizing:border-box;float:left;padding:2px"><p style="box-sizing:border-box;margin:0px"><span style="box-sizing:border-box;font-family:FontAwesome;display:inline-block;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-weight:normal;font-stretch:normal;line-height:1;font-size:inherit;color:rgb(119,119,119)"></span> <a href="https://mantis.web3d.org/view_user_page.php?id=10" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">brutzman</a></p><p style="box-sizing:border-box;font-size:11.05px;font-weight:normal;margin:0px"><span style="box-sizing:border-box;font-family:FontAwesome;display:inline-block;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:1;font-size:inherit;color:rgb(119,119,119)"></span> </p><div style="box-sizing:border-box"></div><div style="box-sizing:border-box;max-height:1px;min-height:1px;overflow:hidden;margin:2px 0px 1px"></div><div style="box-sizing:border-box;display:inline-block;vertical-align:middle"><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_edit_page.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_delete.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_set_view_state.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div></div></div></td><td style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);background-color:rgb(232,232,232);color:rgb(0,0,0);width:767.524px;border-radius:0px">Not found in X3D XML Encoding.<br style="box-sizing:border-box">* 4.3.3.1 DEF and USE attribute syntax<br style="box-sizing:border-box">* <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#DEFAndUSEAttributeSyntax" rel="noopener" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-WD1/Part01/concepts.html#DEFAndUSEAttributeSyntax</a><br style="box-sizing:border-box"><br style="box-sizing:border-box">Not found in X3D ClassicVRML Encoding<br style="box-sizing:border-box">*4.3.3.1 USE node statement syntax<br style="box-sizing:border-box">* <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-2v4.0-WD1/Part02/concepts.html#USEStatementSyntax" rel="noopener" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-2v4.0-WD1/Part02/concepts.html#USEStatementSyntax</a><br style="box-sizing:border-box"></td></tr><tr style="box-sizing:border-box;color:rgb(0,0,0);height:5px"><td colspan="2" style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px"></td></tr><tr id="m_-2123966226880762249gmail-c3881" style="box-sizing:border-box;background-color:rgb(249,249,249)"><td style="box-sizing:border-box;padding:5px;color:rgb(0,0,0);font-weight:bold;vertical-align:top;line-height:1.42857;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);border-radius:0px;background-color:rgb(237,243,244)"><div style="box-sizing:border-box;float:left;padding:2px"></div><div style="box-sizing:border-box;float:left;padding:2px"><p style="box-sizing:border-box;margin:0px"><span style="box-sizing:border-box;font-family:FontAwesome;display:inline-block;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-weight:normal;font-stretch:normal;line-height:1;font-size:inherit;color:rgb(119,119,119)"></span> <a href="https://mantis.web3d.org/view_user_page.php?id=10" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">brutzman</a></p><p style="box-sizing:border-box;font-size:11.05px;font-weight:normal;margin:0px"><span style="box-sizing:border-box;font-family:FontAwesome;display:inline-block;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:1;font-size:inherit;color:rgb(119,119,119)"></span> 2026-03-25 16:59</p><p style="box-sizing:border-box;margin:0px"><br></p><div style="box-sizing:border-box"></div><div style="box-sizing:border-box;max-height:1px;min-height:1px;overflow:hidden;margin:2px 0px 1px"></div><div style="box-sizing:border-box;display:inline-block;vertical-align:middle"><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_edit_page.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_delete.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_set_view_state.php" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div></div></div></td><td style="box-sizing:border-box;padding:5px;line-height:1.42857;vertical-align:top;border-width:1px 0px;border-style:solid;border-color:rgb(221,221,221);background-color:rgb(232,232,232);color:rgb(0,0,0);width:767.524px;border-radius:0px">Added to 4.4.3 DEF/USE semantics<br style="box-sizing:border-box">* <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#DEF_USE_Semantics" rel="noopener" style="box-sizing:border-box;background-color:transparent;color:rgb(51,122,183);text-decoration-line:none" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/concepts.html#DEF_USE_Semantics</a><br style="box-sizing:border-box"><br style="box-sizing:border-box">====<br style="box-sizing:border-box">     Any USE node reference without a corresponding DEF, within the scope of the current scene or prototype declaration, is an error.<br style="box-sizing:border-box"><br style="box-sizing:border-box">     NOTE  DEF names are not required to precede USE references.<br style="box-sizing:border-box">====<br style="box-sizing:border-box"><br style="box-sizing:border-box">TODO confirm no mention of such a "DEF before USE" requirement in X3D Compressed Binary Encoding (CBE)</td></tr></tbody></table></div></div><div><br></div><div>If anyone thinks such a requirement is needed, please holler.  Extra credit if you find that original requirement.</div><div><br></div><div>Thanks for considering the possibilities.  Have fun with X3D!  😀</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></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>