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

Don Brutzman brutzman at nps.edu
Sun May 16 10:23:06 PDT 2021


Followup:  the current XML Schema (and X3DUOM-derived products) allows the presence of two HTML attributes already, /class/ and /style/ in support of Annex L HTML Guidelines.  Additional excerpt and analysis follows.

=================================================
Annex L, HTML authoring guidelines (informative)
L.3.3 Cascading Style Sheets (CSS) considerations

https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD/Part01/htmlGuidelines.html#CSS

Cascading Style Sheets (CSS) is a language for describing the rendering of structured documents (such as HTML and XML) on various display surfaces including screen and paper. CSS is a core language for the World Wide Web that is commonly used for separation of content and presentation, improving layout flexibility.

Design goals for using CSS with X3D include achieving levels of functionality similar to that which exists for using CSS with HTML.

CSS comprises multiple specifications listed in the latest version of CSS Snapshot Recommendation [W3C-CSS-Snapshot]. CSS can be applied and used for Web pages using HTML syntax or XHTML syntax [W3C-HTML5], Scalable Vector Graphics (SVG) [W3C-SVG], and Extensible Markup Language (XML) [W3C-XML] documents, such as models defined using the X3D XML encoding in ISO/IEC 19776-1.

The reserved /class/ attribute on each X3D node can provide a space-separated list of classes that pertain from associated stylesheets.

The reserved /style/ attribute on each X3D node permits direct definition of style information, rather than referring to styles defined in a separate document [W3C-CSS-Style][W3C-CSS-Snapshot].

CSS styling of X3D models follows the specific styling of the parent media element on the HTML page.

The CSS /style/ attribute is not used to override the FontStyle/ScreenFontStyle /style/ field, which is reserved for native X3D style definitions. Instead the parent Text node's CSS /style/ attribute can be used to override FontStyle/ScreenFontStyle styling, if appropriate and supported.
=================================================

So it still seems like a straightforward addition to permissively allow /id/ attribute as well.

Similar suggested prose for X3D Architecture Annex L:

"The reserved /id/ attribute on each X3D node can be considered a unique identifier when used as part of an encompassing HTML/DOM context.  Any /id/ identifiers are in a distinct separate namespace from X3D /DEF/ identifiers and thus are not applicable for USE nodes, ROUTE or Script references."

Now listed in Mantis issue tracker as

* Mantis Annex L.3.3, allowing presence of /id/ attribute on X3D nodes to encourage model usage with HTML
   https://www.web3d.org/member-only/mantis/view.php?id=1363

Absent objections (none heard so far) I plan to test this in our suite of validation tools.  We can keep /id/ for validation (and add diagnostic rules for allowable usage) or else roll it back if a problem emerges.

Thanks for all consideration of this interoperability issue.


On 5/14/2021 8:43 AM, Don Brutzman wrote:
> 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
> 
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD/Part01/htmlGuidelines.html#ContentDefinitionPagePresentation
> 
> 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