Uniface-Compliant Element Declarations

Uniface supports a subset of the element declarations available in the XML standard, namely declarations for root elements, and elements representing entities and fields.

Root Element Declarations

All XML streams have a root element that contains all the other elements in the stream. You can declare the root element of your DTD as follows:

<!ELEMENT RootName(OuterEntity{MultiplicityOperator})>

  • RootName—name of the root element of the entity. The root element is not mapped to any Uniface object, so it is conventional to give the root element the same name as the DTD or to name it ROOT.
  • OuterEntity—name of the element mapped to the outermost Uniface entity in the XML stream.
  • 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.

Element Declarations for Uniface Entities

Uniface component entities are represented as XML elements that can contain other elements representing inner entities and fields. You can declare elements for entities in your DTDs by using the following syntax:

<!ELEMENT EntityName({ InnerEntity 1{MultiplicityOperator} | FieldName 1 }
                              {,InnerEntity 2 {MultiplicityOperator} | FieldName 2}...
                              {, InnerEntity n{MultiplicityOperator} | FieldName n})>

where:

  • EntityName—name of the element mapped to the Uniface entity.
  • InnerEntity—name of an element mapped to an inner entity.
  • FieldName—name an element mapped to a field of the Uniface entity.

Element Declarations for Uniface Fields

An element that represents a field contains PCDATA (string-type data), and no child elements.

<!ELEMENT FieldName (#PCDATA)>

FieldName—name of an element representing a field. FieldName must be specified in the declaration of an entity element.

XML Standard Syntax

For comparison purposes, see the XML standard's syntax for element declarations in XML Element Declaration.