VRML Part 4 logo

4 Concepts

--- VRML separator bar ----

4.1 Introduction and table of contents

4.1.1 Introduction

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.

4.1.2 Table of contents

See Table 4.1 for the table of contents for this clause.

Table 4.1 -- Table of contents, Concepts

4.1 Introduction and table of contents
  4.1.1 Introduction
  4.1.2 Table of contents
  4.1.3 Conventions used

4.2 Overview
  4.2.1 The structure of a VRML file
  4.2.2 Header

4.3 UTF-8 file syntax
  4.3.1 Clear text (UTF-8) encoding
  4.3.2 Statements

  4.3.3 Node statement syntax
  4.3.4 Field statement syntax
  4.3.5 PROTO statement syntax
  4.3.6 IS statement syntax
  4.3.7 EXTERNPROTO statement syntax
  4.3.8 USE statement syntax
  4.3.9 ROUTE statement syntax

4.4 VRML and the World Wide Web
  4.4.1 File extension and MIME type
  4.4.2 Scripting language protocols

 

4.1.3 Conventions used

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.

4.2 Extensible Markup Language (XML)

4.2.1 Overview

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].

4.2.2 XML format

An XML encoding consists of a set of tags identifying functionality and data. The form of XML tag sets is defined in 2.[XML].

4.2.3 Document type definition (DTD)

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.

4.3 Characteristics of the encoding

4.3.1 The structure of a VRML file

A VRML file is structured as defined in ISO/IEC 14772-1 4.2--Introduction.

4.3.2 Header

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.

4.3 X3D file syntax

4.3.1 Use of ID/IDREF

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.

4.3.2 Use of #FIXED Values

#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.

4.3.3 CDATA field types

The following field types are declared as CDATA:

4.3.4 Mapping conventions

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.

4.3.5 Use of document root content model

X3D node is root element. Three definitions are possible without/without/optional Scene tag:

<!ELEMENT X3D ( Scene ) >
<!ELEMENT X3D (
%SceneNodes; ) >
<!ELEMENT X3D ( ( %SceneNodes; ) | Scene ) >

Best: single optional Header tag (similar to HTML's HEAD) and single required Scene tag together:

<!ELEMENT X3D ( Header? , Scene ) >
<!ELEMENT Header ( #PCDATA ) >

--- VRML separator bar ---