logo of XML Sapiens
XML Sapiens Yahoo Group
Join Now
4.3.3 Element Declarations
Beginning » XML Sapiens v.1.1 Specification » 4. Document Structure » 4.3 How to Read the SAPI DTD » 4.3.3 Element Declarations

A SAPI DTD consists of element type declarations and their attributes. The character ends it. Between these the following are specified:

  1. The element name.
  2. Whether the element tag is optional. Two hyphens that appear after the element name mean that the start and end tags are mandatory. One hyphen followed by letter "O" indicates that the end tag can be omitted. A pair of "O" letters indicate that both the start and end tags can be omitted.
  3. The element content, if any. The allowed content for an element is called its content model. Element types that are designed to have no content are called empty elements. The content model for such element types is declared using the keyword "EMPTY".

The following example demonstrates a declaration of an empty element type:

<!ELEMENT sapi:value-of - O EMPTY>

 

4.3.3.1 Content Model Definitions

The content model describes what may be contained by an instance of an element type. Content model definitions may include:

The content model of an element is specified with the following syntax:

( ... ) Delimits groups.

A | B Either A or B must occur, but not both.

A , B Either A or B must occur, in that order.

A & B Both A and B must occur, in any order.

A?A must occur zero or one time.

A*A must occur zero or more times.

A+A must occur one or more time.

Here is a sample SAPI DTD:

<!ELEMENT sapi:exp (CDATA)>

The SAPI:EXP element (see Element SAPI:EXP) may only contain text and character references (see Character References ); - this is indicated by the SGML data type CDATA.

Some SAPI element types use an additional SGML feature to exclude elements from their content model. Excluded elements are preceded by a hyphen. Explicit exclusions override permitted elements.

(C) 2004-2006 Red Graphic Systems. All Rights Reserved. Red Graphic Systems liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.