XML Element Declaration

An element declaration defines the name and content model of an XML element.

The XML standard's syntax for element declarations is as follows:

<!ELEMENT ElementName (Content )>

ContentList has the following format:

{(}ElementName1 MultiplicityOperator connector ElementName 2 MultiplicityOperator... Connector ElementName n MultiplicityOperator{) MultiplicityOperator}

Meaning

  • ElementName—name of the element
  • Content —content allowed for that element. This can be one of the following:
    • EMPTY—no content.
    • ANY—no restrictions on the content.
    • PCDATA—parsed character data (string data).
    • ContentList—list of child elements and PCDATA sections that the element can contain.
  • MultiplicityOperator—single character that defines how many times an element can occur in the stream. The available options are:
    • ?—the element can occur zero or one times in the stream.
    • *—the element can occur zero, once or many times in the stream.
    • +—the element can occur once or many times in the stream.
    • No operator—the element must occur exactly once in the stream.
  • Connector—comma (,) or a pipe (|).

Uniface XML Streams

For information on element declarations for Uniface-compliant XML streams, see Uniface-Compliant Element Declarations.

XML Structs

In an XML-based Struct, an element declaration is represented as a named Struct Named Struct with element name, and one nameless scalar member with the value. The xmlClass tag is element-declaration.

Related Topics