[This local archive copy mirrored from the canonical site: http://CandL.let.ruu.nl/staff/arjan/phd/tei/xps/xpsdtd.htm; links may not have complete integrity, so use the canonical document at this URL if possible.]

     DTD for extended pointer syntax tree (XPS-tree).
     Please tell me if this
     rings a bell.

     The root of any XPS tree is an <xps>. In the DTD the <bridge> is
     defined such that several example xps trees can be shown and parsed
     in single document instance.

     The DTD defines element for nodes in the XPS-tree. An element has
     element content or data content; elements are never mixed with data.
     If data content, the data is the value of the value property
     (expressed through CONREF attributes).
     Other attributes declare additional properties.

     Implied attributes are NULL (empty string, i.e. no value specified).

     Lexical types are defined on all attribute values through primitives and
     literals. Lextype primitives:

     character : any character
                 Regular= (.)
     nonspace  : any character except space
                 Regular= (^\s)
     digit     : any of '1234567890'
                 Regular= (\d)
     name      : any name in accordance with SGML declaration
                 Regular= ([a-zA-z0-9_.]+)
     regexp    : regular expression
                 Regular= ((.)*)
     number    : ('+' | '-')?, digit+
                 Regular= ([+-]?[01234567890]+)
     numtoken  : digit+, name
                 Regular= ([0123456789]+[a-zA-z0-9_.]+)
     sqlit     : ("'", character*, "'")
                 Regular= ("(.)*")
     dqlit     : ('"', character*, '"')
                 Regular= ('(.)*')
     literal   : sqlit | dqlit
                 Regular= ('(.)*')|("(.)*")
     (implied) : Implied by governing notation
     (none)    : No lexical type specifications implied

     Trees for patterns created out of regular expressions are decribed
     in a pattern-DTD (for pattern-trees) (not supplied in this web mirror).
     Bridge element, and character data entities.
<!ELEMENT bridge    O O (xps*)>

    Predefined navigation: Identity and root element: HERE ROOT
    Examples: (here)
<!ENTITY % predef   "root | here">
<!ELEMENT (%predef) - O EMPTY>

    nodes that directly perform a global search: ID REF
    Examples: (here)
<!ELEMENT id        - O (#PCDATA)>
<!ATTLIST id        value CDATA #CONREF
                    -- Reference by elements ID value
                       Lextype: name -->
<!ELEMENT ref       - O (#PCDATA)>
<!ATTLIST ref       value CDATA #CONREF
                    -- Canonical reference
                       Lextype: nonspace+ -->
    Navigators are nodes that navigate into context: CHILD DESCENDANT
    These require a number of steps, each next step to be relative to the
    previous location or navigation result.
    Examples: (here)
<!ELEMENT navigator - O (step)+
                    -- i.e. navigators step though immediate context
                       though 1..n steps -->
                    -- lextype: 'CHILD' | 'DESCENDANT' | 'ANCESTOR' |
                                'PREVIOUS' | 'FOLLOWING' | 'NEXT'
    nodes that acces textual content of a component: PATTERN, TOKEN, STR
    Examples: (here)
<!ELEMENT pattern   - O (#PCDATA)>
<!ATTLIST pattern   value CDATA #CONREF
                    -- Match by regular expression
                       Lextype: regexp+
                    pattern CDATA #IMPLIED
                    -- describes .pattern property, i.e. <pattern> created
                       by parsing (Self value).
                       Lextype: (none)

<!ENTITY % textaddr "token | str"
                    -- Match by absolute position
<!ELEMENT (%textaddr) - O (number,number?)
                    --  i.e. 1 or 2 numbers, specifying (offset : length) -->

    Location expressions in foreign notations: FOREIGN HYQ
    Examples: (here)
<!ENTITY % other    "foreign | hyq"
                    -- i.e. other pointer language expressions:
                       FOREIGN parms, HYQ parms
<!ELEMENT foreign   - O (parm*)>
<!ELEMENT parm      - O (#PCDATA)
                    -- lextype: (implied)
                       Each parm within a <foreign> hold the (bracketed)
                       parameter text for the unspecified foreign notation

<!ELEMENT hyq       - O (#PCDATA)>
<!ATTLIST hyq       value CDATA #CONREF
                    -- lextype: (implied)

    nodes that imply a location action ('location terms')
<!ENTITY % locterm " %predef | id | ref | navigator | pattern |
                     %textaddr | space | %other | ditto "
                     -- i.e. location terms -->

     An expression in the extended pointer syntax is parsed into a
     xps tree rooted in an <xps>, and consisting of location terms.
     This is called the 'ladder' in TEI XPS.
<!ELEMENT xps      - O (%locterm)+ >
<!ATTLIST xps      result CDATA #IMPLIED
                   -- informal description of xps result
                      Lextype: (none)

    A list of numbers
<!ELEMENT numbers  - O (number)+>
<!ELEMENT number   - O (#PCDATA)>
<!ATTLIST number    value CDATA #CONREF
                   -- lextype: number
    Node for addressing a section of an object in a foreign notation: SPACE
    Examples: (here)
<!ENTITY % pointpair "(numbers, numbers?)">
<!ELEMENT space     - O (%pointpair)
                    -- i.e. the locations of each dimension along a
                       Cathesian coordinate space as named in attribute
<!ATTLIST space     name CDATA #REQUIRED
                    -- lextype: character*
                       i.e. name of dimension used in external data entity
    Node for addressing the recorded result of previous XPS query: DITTO
    Examples: (here)
<!ELEMENT ditto     - O EMPTY
                    -- the current xps node. within xps element type,
                       valid only in TO attribute -->

     Single step within navigation: criterium for selecting node.
<!ELEMENT step      - O (avspec*) >
<!ATTLIST step      instance CDATA #REQUIRED
                    -- lextype: number | 'ALL'--
                    element CDATA #IMPLIED
                    -- lextype: name | '#CDATA' | '*' | regexp -->

    Attribute name and attribute value to be matched on current node
    See <step>.
<!ELEMENT avspec    - O (#PCDATA)>
<!ATTLIST avspec    name CDATA #REQUIRED
                    -- lextype: name | '*' | regexp
                    value CDATA #CONREF
                    -- lextype: literal | name | number | numtoken |
                                '#IMPLIED' | '*' | regexp