Stylus Studio XML Editor

Table of contents

Appendices

B Sample DTD

Sample DTD

The following DTD makes invalid (for purposes of argument) all XLink constructs for which this specification does not specify behavior. It is provided only as a convenience for application developers; it has no normative status.

The following assumptions hold for this DTD:

  • Only constructs that have XLink-defined meaning are allowed.

  • No "foreign" vocabularies are mixed in, since DTDs do not work well with namespaces.

  • The use of ANY means there is typically content provided in the element that is used by XLink in some way.

  • The use of the (title*) construct means that any non-title content provided has no XLink-defined use.

  • Elements are named after the XLink element types they represent.

Other assumptions and conditions appear as comments in the DTD.

<!ELEMENT simple ANY>
<!ATTLIST simple
   xlink:type      (simple)        #FIXED "simple"
   xlink:href      CDATA           #IMPLIED
   xlink:role      CDATA           #IMPLIED
   xlink:arcrole   CDATA           #IMPLIED
   xlink:title     CDATA           #IMPLIED
   xlink:show      (new
                   |replace
                   |embed
                   |other
                   |none)          #IMPLIED
   xlink:actuate   (onLoad
                   |onRequest
                   |other
                   |none)          #IMPLIED>

<!ELEMENT extended ((title|resource|locator|arc)*)>
<!ATTLIST extended
   xmlns:xlink     CDATA           #FIXED "http://www.w3.org/1999/xlink"
   xlink:type      (extended)      #FIXED "extended"
   xlink:role      CDATA           #IMPLIED
   xlink:title     CDATA           #IMPLIED>

<!ELEMENT title ANY>
<!-- xml:lang is not required, but provides much of the motivation
      for title elements in addition to attributes, and so is provided
      here for convenience -->
<!ATTLIST title
   xlink:type      (title)         #FIXED "title"
   xml:lang        CDATA           #IMPLIED>

<!ELEMENT resource ANY>
<!ATTLIST resource
   xlink:type      (resource)      #FIXED "resource"
   xlink:role      CDATA           #IMPLIED
   xlink:title     CDATA           #IMPLIED
   xlink:label     NMTOKEN         #IMPLIED>

<!ELEMENT locator (title*)>
<!-- label is not required, but locators have no particular XLink 
     function if they are not labeled -->
<!ATTLIST locator
   xlink:type      (locator)       #FIXED "locator"
   xlink:href      CDATA           #REQUIRED
   xlink:role      CDATA           #IMPLIED
   xlink:title     CDATA           #IMPLIED
   xlink:label     NMTOKEN         #IMPLIED>

<!ELEMENT arc (title*)>
<!-- from and to have default behavior when values are missing -->
<!ATTLIST arc
   xlink:type      (arc)           #FIXED "arc"
   xlink:arcrole   CDATA           #IMPLIED
   xlink:title     CDATA           #IMPLIED
   xlink:show      (new
                   |replace
                   |embed
                   |other
                   |none)          #IMPLIED
   xlink:actuate   (onLoad
                   |onRequest
                   |other
                   |none)          #IMPLIED
   xlink:from      NMTOKEN         #IMPLIED
   xlink:to        NMTOKEN         #IMPLIED>