Document modelling

As with many other adjunct standards, inclusion markup may need to be added to an existing DTD or XML Schema model.

The appropriate markup for inclusion of the Include to a DTD is as follows:

<!ELEMENT xi:include EMPTY>
<!ATTLIST xi:include
          xmlns:xi       CDATA          #FIXED
                         "http://www.w3.org/2001/XInclude"
          href           CDATA          #REQUIRED
          parse          (xml|text)     "xml"
          encoding       CDATA          #IMPLIED>

Note that the default value for the Parse attribute is 'xml', though this is not strictly necessary because a missing Parse attribute is assumed to indicate this mode in any case. This attribute need not be defined at all, if the 'text' mode is not applicable to the application of XML concerned. At the other extreme, however, this attribute could also be defaulted to 'text', if this mode is expected to be more popular than 'xml' mode, or even fixed at this value.

A roughly equivalent XML Schema instance follows (see Chapters 14 and 15):

<x:schema
      xmlns:x="http://www.w3.org/2001/XMLSchema"
      xmlns="http://www.w3.org/2001/XInclude"
      targetNamespace="http://www.w3.org/2001/XInclude">
  <x:element name="include">
    <x:complexType mixed="true">
      <x:attribute name="href"
                   type="x:anyURI"
                   use="required"/>
      <x:attribute name="encoding"
                   type="x:string"/>
      <x:attribute name="parse" default="xml">
        <x:simpleType>
          <x:restriction base="x:string">
            <x:enumeration value="xml"/>
            <x:enumeration value="text"/>
          </x:restriction>
        </x:simpleType>
      </x:attribute>
    </x:complexType>
  </x:element>
</x:schema>

Note that in this case the content of the Include element is not empty (as it is in the DTD variant above). The decision on whether or not to allow the Include element to contain commentary text is left to the author of the schema or DTD model.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.244.153