This clause describes key concepts in this part of ISO/IEC 14772. This includes how the VRML constructs defined in ISO/IEC 14772-1 are encoded as XML.
The XML encoding provides a set of XML general entities and element type declarations for creating an XML-compliant coding of VRML. Except where noted, the semantics for the elements defined herein are described in ISO/IEC 14772-1 and referenced in the section which documents the binding.
The special name X3D has been assigned ot the XML encoding of VRML to more closely associate this encoding with the various XML-related services.
See Table 4.1 for the table of contents for this clause.
The following conventions are used throughout this part of ISO/IEC 14772:
Italics are used for event and field names, and are also used when new terms are introduced and equation variables are referenced.
A fixed-space
font is used for URL addresses and source code
examples. ISO/IEC 14772 UTF-8 encoding examples appear in bold,
fixed-space
font.
Node type names are appropriately capitalized (e.g., "The Billboard node is a grouping node..."). However, the concept of the node is often referred to in lower case in order to refer to the semantics of the node, not the node itself (e.g., "To rotate the billboard...").
The form "0xhh" expresses a byte as a hexadecimal number representing the bit configuration for that byte.
Throughout this part of ISO/IEC 14772, references are denoted using the "x.[ABCD]" notation, where "x" denotes which clause or annex the reference is described in and "[ABCD]" is an abbreviation of the reference title. For example, 2.[ABCD] refers to a reference described in clause 2 and B.[ABCD] refers to a reference described in annex B.
XML, a W3C Recommendation for structured information exchange, has become extremely popular and is both widely and reliably implemented. The XML encoding of VRML builds on this strong foundation and gains many advantages such as a sound basis for internationalization, powerful structuring capability, an object model, and other characteristics. By building on existing, cleanly-implemented specifications, XML-based grammars are open to implementation without a huge reverse engineering effort.
The specification for XML is in 2.[XML].
An XML encoding consists of a set of tags identifying functionality and data. The form of XML tag sets is defined in 2.[XML].
The association between XML tags and an implementation which realize the functionality of those tags is contained in a Document Type Definition or DTD. The DTD for VRML is specified in Annex A.
A VRML file is structured as defined in ISO/IEC 14772-1 4.2--Introduction.
Every XML-encoded VRML file shall begin with:
#VRML V3.0 xml [optional comment] <line terminator>
The header is a single line of UTF-8 text identifying the file as a VRML file and identifying the encoding type of the file. It may also contain additional semantic information. There shall be exactly one space separating "#VRML" from "V3.0" and "V3.0" from "<encoding type>". Also, the "xml" shall be followed by a linefeed (0x0a) or carriage-return (0x0d) character, or by one or more space (0x20) or tab (0x09) characters followed by any other characters, which are treated as a comment, and terminated by a linefeed or carriage-return character.
DEF/USE is defined as ID/IDREF. As a validation constraint, duplicate DEFs are not allowed within the XML file. Compatibility with VRML can be provided if conversion processors notify the user of any conflict and request action or by validation of a converted file (from VRML to XML/X3D) using the Document Type Definition provided herein.
Implementors must ensure that any element that contains a USE element does not have other attributes in the containing element. This is an X3D constraint. It does not affect XML validation.
#FIXED values in Document Type Definitions define an attribute type whose instance value is fixed, that is, provided by the application or passed from the XML processor during validation. Note that non-validating XML parsers are not required to provide default values.
eventOut elements provide a value attribute. The content of these attributes is declared herein as #FIXED attributes which may update at runtime.
The following field types are declared as CDATA:
In creating the X3D Document Type Definitions, for most cases, S/F and M/F nodes have been mapped to child elements and fields have been mapped to XML attibute lists.
X3D node is root element. Three definitions are possible without/without/optional Scene tag:
<!ELEMENT X3D ( Scene ) >
<!ELEMENT X3D (
Best: single optional Header tag (similar to HTML's HEAD) and single required Scene tag together:
<!ELEMENT X3D ( Header? , Scene ) >
<!ELEMENT Header ( #PCDATA ) >