<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">Mantis 1526: relaxing requirement for DEF prior to USE - Web3D MantisBT</a></li><li><a href="https://mantis.web3d.org/view.php?id=1526">https://mantis.web3d.org/view.php?id=1526</a></li></ul><div><table class="gmail-table gmail-table-bordered gmail-table-condensed" 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 class="gmail-bug-description gmail-category" 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 class="gmail-bug-description" 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 class="gmail-bug-additional-information gmail-category" 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 class="gmail-bug-additional-information" 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">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 class="gmail-table gmail-table-bordered gmail-table-condensed gmail-table-striped" 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 class="gmail-bugnote gmail-visible-on-hover-toggle" id="gmail-c3879" style="box-sizing:border-box;background-color:rgb(249,249,249)"><td class="gmail-category" 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 class="gmail-pull-left gmail-padding-2" style="box-sizing:border-box;float:left;padding:2px"></div><div class="gmail-pull-left gmail-padding-2" style="box-sizing:border-box;float:left;padding:2px"><p class="gmail-no-margin" style="box-sizing:border-box;margin:0px"><span class="gmail-fa gmail-fa-user gmail-grey" 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">brutzman</a></p><p class="gmail-no-margin gmail-small gmail-lighter" style="box-sizing:border-box;font-size:11.05px;font-weight:normal;margin:0px"><span class="gmail-fa gmail-fa-clock-o gmail-grey" 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 class="gmail-clearfix" style="box-sizing:border-box"></div><div class="gmail-space-2" style="box-sizing:border-box;max-height:1px;min-height:1px;overflow:hidden;margin:2px 0px 1px"></div><div class="gmail-btn-group gmail-visible-on-hover" style="box-sizing:border-box;display:inline-block;vertical-align:middle"><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_edit_page.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_delete.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_set_view_state.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div></div></div></td><td class="gmail-bugnote-note gmail-bugnote-public" 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">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">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 class="gmail-spacer" 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 class="gmail-bugnote gmail-visible-on-hover-toggle" id="gmail-c3881" style="box-sizing:border-box;background-color:rgb(249,249,249)"><td class="gmail-category" 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 class="gmail-pull-left gmail-padding-2" style="box-sizing:border-box;float:left;padding:2px"></div><div class="gmail-pull-left gmail-padding-2" style="box-sizing:border-box;float:left;padding:2px"><p class="gmail-no-margin" style="box-sizing:border-box;margin:0px"><span class="gmail-fa gmail-fa-user gmail-grey" 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">brutzman</a></p><p class="gmail-no-margin gmail-small gmail-lighter" style="box-sizing:border-box;font-size:11.05px;font-weight:normal;margin:0px"><span class="gmail-fa gmail-fa-clock-o gmail-grey" 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 class="gmail-no-margin" style="box-sizing:border-box;margin:0px"><br></p><div class="gmail-clearfix" style="box-sizing:border-box"></div><div class="gmail-space-2" style="box-sizing:border-box;max-height:1px;min-height:1px;overflow:hidden;margin:2px 0px 1px"></div><div class="gmail-btn-group gmail-visible-on-hover gmail-invisible" style="box-sizing:border-box;display:inline-block;vertical-align:middle"><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_edit_page.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_delete.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div><div class="gmail-pull-left" style="box-sizing:border-box;float:left"><form method="post" action="https://mantis.web3d.org/bugnote_set_view_state.php" class="gmail-form-inline gmail-inline gmail-single-button-form" style="box-sizing:border-box;margin:0px 1px 0px 0px;display:inline-block"></form></div></div></div></td><td class="gmail-bugnote-note gmail-bugnote-public" 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">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" data-smartmail="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>