The WebCGM XML Companion File (XCF) was added to WebCGM in the 2.0
version, and further enhanced in this 2.1 upgrade. The element and attribute
definitions found in this section represent the WebCGM XCF DTD. This DTD may
be extended by profiles deriving from WebCGM. The WebCGM XML companion files
may be used for several purposes. There are many conceivable usage scenarios,
but for the scope of WebCGM, the following four were identified as most
important.

Scenario 1: A companion file can be used to bind
application specific details (such as a part number) to a particular
Application Structure. It is up to the application to control how the
application-specific information is used.

Example
4.1: A companion file used to relate some application-specific
data to graphical objects.

Scenario 3: Although it is out-of-scope of this version
of the WebCGM XCF to fully mirror the hierarchical structure of a CGM graphic
(see "Structure overview"), an XML Companion File
could be used as a partial, scaled down XML inventory of a CGM illustration
by enumerating the Application Structures IDs, types and (most)
attributes.

Example 4.3: A
companion file used as a partial inventory of sample_3.cgm. In this case, the
description puts an emphasis on the hotspot region of each 'grobject'
element.

It is not the intent of the WebCGM XML Companion File (XCF) to be a
faithful XML representation of the object tree in a hierarchical WebCGM.
Rather, XCF provides a mechanism to externalize both standardized and
application (private) metadata from a structured WebCGM instance, and to bind
it to the proper objects in the object tree of the WebCGM instance.

Accordingly, the structure of the XML Companion File is mostly flat. After
the root element, webcgm, the various standard XCF elements occur as siblings in the companion
file (with the single exception of linkuri). So, for example, grobjects
that have a parent-child relationship in the CGM are siblings in the XCF. The
normative WebCGM DTD for XCF expresses and enforces this flat structure,
independent of whatever hierarchy may exist in the corresponding WebCGM
instance.

Note: Example 4.4 uses a condensed schematic representation of the CGM
code, eliminating numerous details in order to illustrate the point.

Example 4.4 illustrates another point about the relationship of the XCF
contents to the corresponding WebCGM instance — the order of the XCF is
not required to follow the order of the CGM contents.

As suggested by Example 4.4, the root element of a conforming XCF instance
must be the webcgm element. The
webcgm element corresponds to the Picture object in the CGM. See
Relationship with XML Companion
File for more discussion.

The next section deals in detail with application-specific metadata
attributes and elements in an XCF. In order to unambiguously establish where
in the WebCGM object tree those metadata are to be inserted, the
application-specific attributes and elements (defined in a separate
namespace) are placed in the XCF as attributes and child elements on
standardized XCF elements that correspond (bind) to the appropriate object in
the WebCGM. This is seen in example 4.1, for application-specific attributes.
See also section Relationship with
XML Companion File for more discussion.

The WebCGM DTD is extensible so that application-specific or
industry-specific metadata may be added to the WebCGM object model (as shown
in example 4.1). The extension definitions are implemented using namespaces.
The DTD defines an extension entity for the content and attributes of most
elements. As an example, a part manufacturer may want to associate parts
information to graphical objects. This might be implemented with an extension
that looks like:

<!ENTITY % grobjectAttEXT "model:partNum CDATA #IMPLIED" >

A host application could query the WebCGM DOM and retrieve the associated
part information.

A set of rules must be followed when extending the WebCGM DTD:

The root element MUST be 'webcgm'.

The extended elements and/or attributes MUST be in another namespace
(See Namespaces in
XML).

Extending the list of children of an element MUST use the
elementNameEXT entity.

Extending the attribute list of an element MUST use the
elementNameAttEXT entity.

Elements from the WebCGM namespace MUST NOT be descendants of other
namespaced elements.

A file is a conforming WebCGM 2.1 XCF document if it adheres to the
specifications described in this (WebCGM 2.1) document, including those in
the WebCGM 2.1 XCF DTD, and in addition all of
the following conditions are met:

if all non-WebCGM namespace elements and attributes and all
xmlns attributes which refer to non-WebCGM namespaces
are removed from the given document, and if an appropriate document type declaration (i.e.,
<!DOCTYPE webcgm ... >) which points to the WebCGM DTD is included
immediately after the XML declaration (i.e., <?xml...?>), the
result is a valid
XML document.

it conforms to Namespaces
in XML, if any namespaces other than WebCGM are used in the
document.

and a pair of general purpose metadata binding elements —
bindById and bindByName.

The standard XCF elements also include:

linkuri. Linkuri is an APS Attribute, but is encoded as an
XCF element, rather than attribute, to avoid what would otherwise be an
overly complex encoding of the string that would comprise its value as an
XML attribute.

For the standardized XCF content, most of the items expressed on XCF
elements as XML attributes have a straightforward correlation to a
standardized WebCGM attribute or property that may be set or inquired with a
WebCGM DOMcall.

In general, the encoding of XML attributes on XCF elements is identical to
the encoding of the corresponding parameters in DOM calls. For example, the
WebCGMAppStructure interface (section
5.7.6) defines 'viewcontext' as a simple string of four numbers, whitespace
separated (see Wsp definition, section
5.5). The encoding of 'viewcontext' as an XML attribute on any allowed XCF
element is the same as its encoding as a DOM method parameter.

Similarly, the Style
Properties (settable on the WebCGMPicture and WebCGMAppStructure
interfaces), as XML attributes on the XCF elements have the same valid values
and are encoded identically as in the corresponding DOM calls.

The single exception to the use of consistent encodings is for the 'linkuri' APS attribute, which is encoded as an element
in the XCF, for reasons as explained.

Most of the XCF elements may have Style Properties as XML
attributes (Style Properties are defined and supported on the DOM WebCGMPicture and WebCGMAppStructure interfaces.) The
following entity definition is used in the DTD snippets of the subsequent
subsections, on those elements which support Style Properties at both the APS
level and Picture level. (The background-color Style Property that applies
only at the Picture level.)

A single WebCGM XCF element must not contain both the
intensity property and one or more of the overlapping properties
fill-color, stroke-color, text-color.
Overlapping properties may occur sequentially on different XCF elements, and
then their processing is defined by their order of occurrence (see Style Properties
description).

A WebCGM companion file (or any other CGM profile derived from the WebCGM
profile) must have a 'webcgm' element as the root element. The 'webcgm'
element corresponds to the Picture node in the WebCGM DOM tree (see for
example the WebCGMPicture interface in
the DOM).

id="xml:id"
Standard XML attribute for assigning a unique identifier to an element. Refer
to Extensible Markup Language (XML) 1.0 [XML10].version="CDATA"
Represents the version of the WebCGM specification. The value is 2.1 for this
specification. Every conforming XCF must identify its version, either by
including this attribute on the webcgm element, or by including a DOCTYPE pointing to this WebCGM XCF's DTD, or both
(recommended). An industry-specific profile derived from this WebCGM XCF
specification must not use this attribute to identify its version, and should
define and require use of a namespace attribute to identify its profile
version. For example, if ASD includes in its future version of S1000D "n.m"
an XCF derived from WebCGM 2.1, the webcgm tag might look like
this:

filename="CDATA"
Represents the filename of the corresponding WebCGM file. 'filename' is a
descriptive attribute.xmlns[:prefix]="CDATA"
Standard XML attribute whose value defines the "resource-name" for
identifying an XML namespace. Refer to Namespaces in XML. The 'xmlns'
attribute without prefix identifies the (default) WebCGM
namespace, and (with prefix) must be used to identify the foreign
namespace(s) of any application-specific metadata
that are used in the XCF instance. Note that the value given in the DTD snippet, and the attribute type (#FIXED),
apply only to the unprefixed, default WebCGM namespace.

In the first example, the WebCGM namespace is declared as the default
namespace for the webcgm element and its contents, and content
in the 'asd' namespace would use the "asd:" prefix. As the DTD shows, the second example is also valid
because the namespace IRI defaults properly
for the xmlns attribute without prefix. It is recommended,
however, that the xmlns attribute declaring the default (WebCGM)
namespace always be included.

background-color="CDATA"
background-color is a Style
Property for setting the background color of the Picture (root node of
WebCGM object tree).pictureVisibility="on|off"
Defines the visibility for the picture that corresponds to the
webcgm element of this XCF. This is similar to the 'visibility'
APS Attribute that can be applied to metafile Application Structures, except
it applies to the picture (on which the 'visibility' APS Attribute is not
allowed by CGM rules.) The effect is the same as the invocation of the
setPictureVisibility method on the WebCGMPicture interface of the DOM. .styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. webcgmEXT
the webcgmEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the root node. webcgmAttEXT
the webcgmAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the root node.

Attribute definitions:apsid="xml:id"
The unique identifier of the Application Structure for the given WebCGM
file.layerdesc="CDATA"
Value of the 'layerdesc' Application Structure attribute for the associated
APS.visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. layerEXT
the layerEXT entity is a mechanism for adding additional child content (i.e.,
metadata) on the 'layer'.layerAttEXT
the layerAttEXT entity is a mechanism for adding additional attributes (i.e.,
metadata) on the 'layer'.

Attribute definitions:apsid="xml:id"
The unique identifier of the Application Structure for the given WebCGM
file.screentip="CDATA"
Value of the 'screentip' Application Structure attribute for the associated
APS.region="CDATA"
Value of the 'region' Application Structure attribute for the associated
APS.viewcontext="CDATA"
Value of the 'viewcontext' Application Structure attribute for the associated
APS.visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. grobjectEXT
the grobjectEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the 'grobject'.grobjectAttEXT
the grobjectAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the 'grobject'.

Attribute definitions:apsid="xml:id"
The unique identifier of the Application Structure for the given WebCGM
file.screentip="CDATA"
Value of the 'screentip' Application Structure attribute for the associated
APS.region="CDATA"Value of the 'region' Application Structure attribute for the
associated APS.
viewcontext="CDATA"Value of the 'viewcontext' Application Structure attribute for the
associated APS.
visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. paraEXT
the paraEXT entity is a mechanism for adding additional child content (i.e.,
metadata) on the 'para'.paraAttEXT
the paraAttEXT entity is a mechanism for adding additional attributes (i.e.,
metadata) on the 'para'.

Attribute definitions:apsid="xml:id"
The unique identifier of a the Application Structure for the given WebCGM
file.screentip="CDATA"
Value of the 'screentip' Application Structure attribute for the associated
APS.region="CDATA"
Value of the 'region' Application Structure attribute for the associated
APS.viewcontext="CDATA"
Value of the 'viewcontext' Application Structure attribute for the associated
APS.
visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. subparaEXT
the subparaEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the 'subpara'.subparaAttEXT
the subparaAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the 'subpara'.

A 'linkuri' element of an XML companion file represents a WebCGM 'linkuri'
Application Structure attribute. Contrary to other attributes, the 'linkuri'
attribute is expressed as an element in the XML companion file. The
corresponding Application Structure of this 'linkuri' is its parent
element.

Attribute definitions:uri="CDATA"
The IRI of
this 'linkuri' attribute. See section Basic Data Types for more
information.behavior="CDATA"
The behavior of this 'linkuri' attribute. See section Basic Data Types for more
information.desc="CDATA"
The title or description of this 'linkuri' attribute. See section Basic Data Types for more
information. linkuriEXT
the linkuriEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the 'linkuri'.linkuriAttEXT
the linkuriAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the 'linkuri'.

A 'bindByName' element of an XML companion file is intended to correspond
to one or more Application Structure in a CGM file. The common link between
those Application Structures is that their 'name' or 'layername' attribute
value corresponds to 'apstargetname'. See section Relationship with XML companion
file for more information on the rules of mapping 'bindByName'
attributes to WebCGM Application Structures.

Attribute definitions:apstargetname="CDATA"
Name used to identify the corresponding Application Structure(s) for a given
WebCGM file.screentip="CDATA"
Value of the 'screentip' Application Structure attribute for the associated
APS.region="CDATA"
Value of the 'region' Application Structure attribute for the associated
APS.viewcontext="CDATA"
Value of the 'viewcontext' Application Structure attribute for the associated
APS.layerdesc="CDATA"
Value of the 'layerdesc' Application Structure attribute for the associated
APS.visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. bindByNameEXT
the bindByNameEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the APS.bindByNameAttEXT
the bindByNameAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the APS.

The 'bindById' element of an XML companion file represents a CGM
Application Structure one of the types: layer, grobject, para, subpara. APS
of type 'grnode' are valid in a 'bindById' element. The corresponding object
is identifiable given its assigned 'apsid' attribute value. See section
Relationship with XML companion
file for more information on the rules of mapping 'bindById'
attributes to WebCGM Application Structures.

Attribute definitions:apsid="xml:id"
The unique identifier of the Application Structure for the given WebCGM
file.screentip="CDATA"
Value of the 'screentip' Application Structure attribute for the associated
APS.region="CDATA"
Value of the 'region' Application Structure attribute for the associated
APS.viewcontext="CDATA"
Value of the 'viewcontext' Application Structure attribute for the associated
APS.
layerdesc="CDATA"
Value of the 'layerdesc' Application Structure attribute for the associated
APS.visibility="on|off|inherit"
Value of the 'visibility' Application Structure attribute for the associated
APS.interactivity="on|off|inherit"
Value of the 'interactivity' Application Structure attribute for the
associated APS.styleProperties
the styleProperties entity collectively defines those Style Properties that apply at
both the Picture level and the object/APS level. bindByIdEXT
the bindByIdEXT entity is a mechanism for adding additional child content
(i.e., metadata) on the APS.bindByIdAttEXT
the bindByIdAttEXT entity is a mechanism for adding additional attributes
(i.e., metadata) on the APS.