[x3d-public] allowing presence of /id/ attribute on X3D nodes to encourage model usage with HTML

Don Brutzman brutzman at nps.edu
Fri May 14 08:43:10 PDT 2021

An excellent question arose this week during refinement of X3D audio component examples by Efi Lakka.

Should we allow presence of id attribute on X3D nodes to encourage modelusage with HTML?

Current X3D4 Committee Draft (CD) sayeth:

Annex L, HTML authoring guidelines (informative)
L.3.1 Content definition and page presentation


There are two basic approaches to loading X3D models within HTML pages:

* Including X3D model elements within an HTML page, or else
* Referencing an external X3D model in an HTML page media element.

For X3D elements appearing within HTML document source, the HTML/DOM /id/ attribute can be used for selecting X3D model elements using HTML-page Script nodes (as can any other HTML selector such as CSS). Such node identification is similar to the use of DEF when X3D events are passed by a ROUTE connection, allowing disambiguation of specific node instances when needed.

We already support the /style/ attribute in X3D Unified Object Model (X3DUOM) for use by X3D models with HTML or XML.  No problems encountered with that.

Similarly seems like we should also support the /id/ attribute as an allowed value on an X3D node.  Note that /id/ is not the same as the DEF value, and so /id/ would have type NMTOKEN and not a scene-unique ID type.  Further diagnostics might be added to X3D Schematron to confirm that ROUTE and USE definitions only matched DEF values, not solitary /id/ values.

A good practice might be to have the same value for /id/ and DEF on a node, but that is an authoring preference since some might find it confusing or ambiguous.  Other authoring patterns are possible.  The X3D and HTML5 specifications are co-aligned so that such choices should be independent and legal regardless of author choice.

Allowing /id/ value definitions in a scene also facilitates reuse of X3D models with HTML regardless of their original form.  Better validation of original models leads to better Quality Assurance (QA) and better X3D/HTML interoperability.

Therefore, propose adding /id/ attribute to X3D XML Schema, DOCTYPE, Tooltips, Schematron and X3DUOM (thus leading to X3DJSAIL, X3DPSAIL and X3D Ontology).  This would seem to have no effect on X3D Architecture specification, presentation or functionality of scenes.

Downstream Dick and I can look at whether this deserves mention in Scene Authoring Interface (SAI) specification, presumably as an allowed but optional/nonfunctional characteristic.

Comments welcome.  We'll discuss further in X3D Working Group weekly teleconferences.

all the best, Don
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

More information about the x3d-public mailing list