<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2010, v.4002-->
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN"
 "topic.dtd">
<?Pub Sty _display FontColor="red"?>
<topic id="xsreadme" xml:lang="en">
<title>DITA XML Schema Readme </title>
<shortdesc>This document described the release notes and usage of
the experimental DITA XML Schema on <tm tmclass="ibm"
tmowner="IBM Corporation" tmtype="reg" trademark="developerWorks">developerWorks</tm>.</shortdesc>
<body>
<note>This information is considered out of date. Since DITA 1.0,
the DITA Schemas have provided equivalent function to DTDs, and are
considered stable and reliable. For more recent information about
Schema design patterns, see <xref format="html"
href="http://docs.oasis-open.org/dita/v1.1/OS/archspec/schemamod.html"
scope="external">the DITA 1.1 Architectural Specification</xref>.</note>
<required-cleanup><p>This DITA release includes an implementation of the topic architecture        in XML Schema. The DTDs are still the canonical representation of DITA.        The design pattern for the DITA Schemas is based on the W3C XML Schema        1.0 Specification and may be subject to change in the future.</p><p>The specialization process and design pattern for the DITA XML Schema        are still being developed and refined. As such, the specialization        process stated below should not interpreted as &quot;the definitive        process&quot;, but simply one method to specialize information types and        domains. </p><p>A public mailing/discussion list to support users of DITA is available        at <xref
href="http://groups.yahoo.com/group/dita-users/" type="external">Yahoo!Groups &apos;dita-users&apos;</xref></p><topic
id="xsusing">
<title>Using DITA XML Schemas</title>
<body>
<p>There are a number of tools available to create, validate, or          transform DITA XML Schemas. Here is a small list:</p>
<ul>
<li><tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg"
trademark="WebSphere">WebSphere</tm> Studio Advanced Developer 5.1</li>
<li>Xerces 2.6.X</li>
<li>Saxon-SA 8.X</li>
</ul>
<p>You can invoke Xerces XML document validation using SAX or DOM via the          command-line:</p>
<pre> java sax.Counter -v -s [xmlDocument] java dom.Counter -v -s 
        [xmlDocument]</pre>
</body>
</topic><topic id="xsinfo">
<title>Information for DITA XML Schema</title>
<body>
<p>The DITA XML Schema architecture attempts to follow the naming          convention established in the current DITA DTD architecture. Each          element has its own named content model, i.e., topic.class for the          topic element. Attributes that have an enumerated list of values in the          DTD have their own class too, such as importance-att.class for the          attribute important. </p>
<ul>
<li>All the elements in the base topic module are global. This will            allow any element to be specialized.</li>
<li>All the attributes are local to the element&apos;s content model,            except for the class attribute.</li>
<li>All the parametric entities in the DTD are named element groups            with the same name as the DTD, such as basic.ph and ph.cnt.</li>
<li>All elements in specialized schema module are declared globally as            abstracted elements, except for the root element. The specialized            element must also be declared locally in the derived content            models.</li>
</ul>
<p>This version of the DITA XML Schema does not use W3C XML Schema          inheritance to model the DITA Architecture. In previous attempts to use          the more efficient inheritance model, various Schema processors have          implemented the &quot;particle restriction&quot; rules inconsistently.          In order to have the same functionality as substitutionGroups without          inheritance, a new layer was added to the design pattern. </p>
</body>
</topic><topic id="xsspec">
<title>XML Schema Specialization</title>
<body>
<section>         <title>Creating a New Information Type</title>         <p>Here are some simple steps that will make specialization easier            according to the present design pattern:</p>         <ol>
<li>Create a new information type schema document.<p>This schema              document is a shell for the new information type. In it one              includes parent information types and existing or new              domains.</p><ul>
<li>Copy the contents of the parent specialization              into the new *.xsd file.</li>
<li>Add an include statement for the              *.mod in the XML Schema document.<pre>&lt;xs:include schemaLocation=&quot;mySpec.mod&quot; /&gt;</pre></li>
</ul></li>
<li>Create a new information type module. <ul>
<li>Create a new              global element. </li>
</ul><ul>
<li>Create a new content model for              the element. For most elements the following template will do.<pre>    &lt;xs:complexType name=&quot;myElement.class&quot; mixed=&quot;true&quot; &gt;
      
    &lt;/xs:complexType&gt;</pre>             </li>
</ul><ul>
<li>Copy the content of the parent element&apos;s              content model–everything between the elements &lt;xs:choice&gt;,              &lt;xs:sequence&gt;, or &lt;xs:all&gt;–into the new element&apos;s              content model. For example:<pre>    &lt;xs:choice minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;

    &lt;/xs:choice&gt;</pre></li>
<li>Modify the class              attribute default value. <p><pre>&lt;xs:attribute 
            ref=&quot;class&quot; default=&quot;- topic/ph mySpec/mySpecElement 
            &quot;/&gt; </pre>The class attribute value starts and ends with              white space, and contains a list of blank-delimited values. Each              value has two parts: The first part identifies a topic type, and              the second part (after a /) identifies an element type. The class              attribute must include a mapping for every topic type in the              specialized type&apos;s ancestry, even those in which no element              renaming occurred</p></li>
<li> <b>Optional: modify the element              content model.</b> </li>
</ul></li>
<li>Create a new information type group document, for example,              mySpec.grp .<p>This file is a new part of the specialization for              this release. The main reason for this new file is to support mimic              schema inheritance without using the inheritance model in W3C XML              Schema 1.0 specification. The process is very similar to the DITA              DTD design pattern. Each element has its owned named group content              model.</p><p>Each information type has its own *.grp file. In it              one defines a new group for each new specialized element in the              information type. <b>More will be explained </b></p><p> <pre> 
            &lt;xs:group name=&quot;myElement&quot;&gt; &lt;xs:sequence&gt; 
            &lt;xs:element ref=&quot;myElement&quot; /&gt; &lt;/xs:sequence&gt; 
            &lt;/xs:group&gt;</pre> </p></li>
<li>Create a new &apos;domains document&apos; for the information              type, for example meSpec_domains.mod .<p>A domain specialization              &apos;domains document&apos; lists the specialized elements              provided by the domain for a base element. The &apos;domains              document&apos; is used to redefine the information type group              document. For example: <pre>&lt;xs:redefine 
            schemaLocation=&quot;mySpec.grp&quot; /&gt; &lt;xs:group 
            name=&quot;keyword&quot;&gt; &lt;xs:choice&gt; &lt;xs:group 
            ref=&quot;keyword&quot;/&gt; &lt;xs:group 
            ref=&quot;md-d-keyword&quot; /&gt; &lt;/xs:choice&gt; 
            &lt;/xs:group&gt;</pre><b>balh</b></p></li>
</ol>       </section>
<section>         <title>Creating a new Domain</title>         <ol>
<li>Create a new schema document for the new domain. For example,              myDomain-domain.mod .<ul>
<li>Create a new global element. </li>
<li>Create a new content model for the element. For most elements              the following template will do.<pre>    &lt;xs:complexType name=&quot;myDomainElement.class&quot; mixed=&quot;true&quot; &gt;
      
    &lt;/xs:complexType&gt;</pre></li>
</ul><ul>
<li>Copy the              content of the parent element&apos;s content model, every thing              between the elements &lt;xs:choice&gt;, &lt;xs:sequence&gt;, or              &lt;xs:all&gt;, into the new element&apos;s content model. For              example:<pre>    &lt;xs:choice minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;

    &lt;/xs:choice&gt;</pre></li>
</ul><ul>
<li>Create a named group that will              contain the new domain elements that will be used.<p>              <pre>&lt;xs:group name=&quot;md-d-pre&quot;&gt; &lt;xs:choice&gt; 
            &lt;xs:element ref=&quot;myDomainElement&quot;/&gt; &lt;/xs:choice 
            &gt; &lt;/xs:group &gt;</pre> </p></li>
</ul></li>
<li>Modify the class attribute default value.<p><pre>&lt;xs:attribute 
            ref=&quot;class&quot; default=&quot;+ topic/pre 
            md-d/myDomainElement &quot;&gt;</pre>For a domain element, the              value of the class attribute must start with a plus sign. Elements              provided by domains should be qualified by the domain              identifier.</p></li>
</ol>       </section>
<section>         <title>Integrating a Domain in an Information Type Shell            Document</title>         <p>There are two types of domain specializations which can be added to            an information type: <ul>
<li>A new domain</li>
<li>A new domain            specialized from an existing domain.</li>
</ul></p>         <p>Each type domain specialization integrates slightly differently with            the information type shell document. </p>         <ol>
<li>Include the domain module in the information type shell document,              for example mySpec.xsd .</li>
<li>Create a new &apos;domains document&apos; for the information              type, for example meSpec_domains.mod .<ul>
<li>If the domain to be              added <u>is not</u> a specialization of another domain:<ol>
<li>Copy the contents from topic_domains.mod (or similar              &apos;domains document&apos; that already integrate domain of              interest) into a new &apos;domains document&apos;. For example,              mySpec_domains.mod .</li>
<li>Add the named groups (md-d-pre) from              the new domain to the appropriate named group in the &apos;domains              document&apos;.<pre>&lt;xs:redefine schemaLocation=&quot;mySpec.grp&quot; /&gt;
&lt;xs:group name=&quot;pre&quot;&gt;
  &lt;xs:choice&gt;
    &lt;xs:group ref=&quot;pre&quot;/&gt;
    &lt;xs:group ref=&quot;md-d-pre&quot; /&gt;
  &lt;/xs:choice&gt;
&lt;/xs:group&gt;</pre></li>
</ol></li>
<li>If the domain to be added              <u>is</u> a specialization of another domain:<ol>
<li>Create a new              &apos;domains document&apos; for the information type, for example              mySpec_domains.mod .</li>
<li>Include the new &apos;domains              document&apos; in the information type shell document<pre>&lt;xs:include schemaLocation=&quot;mySpec_domains.mod&quot; /&gt;</pre></li>
<li>Remove the topic_domains.mod (or relevant &apos;domains              document&apos;) and parent domain from the information type shell              document and copy the new &apos;domains document.</li>
<li>Use the              redefine mechanism to add the new domain element to parent name              group content model.<pre>&lt;xs:include schemaLocation=&quot;topic_domains.mod&quot;/&gt;
&lt;xs:redefine  schemaLocation=&quot;ui-domain.mod&quot;&gt;
  &lt;xs:group name=&quot;ui-d-ph&quot;&gt;
    &lt;xs:choice&gt;
        &lt;xs:group ref=&quot;ui-d-ph&quot;/&gt;
        &lt;xs:group ref=&quot;md-d-mydomainelt&quot; /&gt;
     &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
&lt;/xs:redefine&gt;</pre></li>
</ol></li>
</ul></li>
</ol>       </section>
</body>
</topic><topic id="xsjava">
<title>Validate XML Schema using <tm tmclass="special"
tmowner="Oracle and/or its affiliates" tmtype="tm" trademark="Java">Java</tm></title>
<body>
<section>         <title>Using Sun <tm tmclass="special"
tmowner="Oracle and/or its affiliates" tmtype="tm" trademark="Java">Java</tm> Development Kit (JDK)1.4.X            and Xerces 2.6.X</title>         <p>The Sun JDK 1.4.X has a built-in XML parser as part of the            distribution. It is called Crimson. Unfortunately, Sun&apos;s Crimson            parser only supports DTD validation. </p>         <p>Sun provides a mechanism to override the classes in the JDK.            It&apos;s called the <xref
href="http://java.sun.com/j2se/1.4.1/docs/guide/standards/"
type="external">Endorsed Standards Override Mechanism</xref></p>         <p>For example, copy a version of the xercesImpl.jar and xml-apis.jar            to &lt;java_home&gt;/jre/lib/endorsed. Here &lt;java-home&gt; refers            to the directory where the Sun JDK is installed. Check the Xerces            version via the included Version application using the following            command-line syntax.</p>         <pre>java -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser org.apache.xerces.impl.Version
  </pre>         <note>Java 2 Platform, Standard Edition (J2SE) 5.0 and IBM Developer            Kit includes Xerces 2.6.2 as the built-in XML parser.</note>       </section>
</body>
</topic><topic id="xsvalidate">
<title>Java Application - ValidateXMLDoc</title>
<body>
<p>You can use the Java application ValidateXMLDoc to validate an XML          document using an external XML Schema. The XML parser must support          <xref
href="http://java.sun.com/xml/jaxp/faq.html" type="external">JAXP          1.2.</xref>. In Xerces&apos; case, version 2.6.x. For example:</p>
<pre>java ValidateXMLDoc ../DITA-XS-readme.xml -s ditabase.xsd Usage: 
        java ValidateXMLDoc xmlDoc [options] 
        ----------------------------------------------------------------------------------------------------------- 
        The application will attempt to validate the instance document using 
        the DOCTYPE value by default. options: -s Validate the instance 
        document using the defined noNamespaceSchemaLocation value. [xmlSchema] 
        Validate instance document using an external XML Schema URI: The 
        location of an external no namespace XML Schema relative to the xml 
        document. This will override the DTD/XML Schema that is defined in the 
        XML document&quot; 
        -----------------------------------------------------------------------------------------------------------</pre>
</body>
</topic><topic id="xstransform">
<title>Java Application - TransformUsingXMLSchema</title>
<body>
<p>The Java application TransformUsingXMLSchema is used to transform an          XML document using XML Schema validation. Most transform engines use          DTD validation by default to build an in-memory document. The          transformation engines need explicit instruction to use XML Schema          validation instead of DTDs. The xsi:noNamespaceSchemaLocation attribute          must be specified in the XML document for the application to works as          expected. For example:</p>
<pre>java TransformUsingXMLSchema ../lawnmower.xml 
        ../../xsl\topic2html.xsl ../lawnmower.html Usage: java 
        TransformUsingXMLSchema xmlDoc xsltDoc htmlDoc 
        ----------------------------------------------------------------------------------------------------------- 
        xmlDoc: The external URI location of an XML document to transform 
        xmlSchema: The external URI location of an XSL stylesheet htmlDoc: The 
        external URI location to write the resultant HTML document 
        -----------------------------------------------------------------------------------------------------------</pre>
<note type="note">The implied value for the class attribute, defined in          the schema, is necessary for DITA XSLT scripts to work properly. If you          see no output, or text-only output, this is usually an indication that          the class attribute&apos;s default value has not been provided during          parsing. Use the normalize.xsl transform to check the output of the          parser: if the class attribute is missing, or the value is not bounded          at the end by a space, the transforms cannot do class-based matching          properly. </note>
<lines> Eric Sirois <xref href="mailto:esirois@ca.ibm.com"
type="external">esirois@ca.ibm.com</xref> IBM Corporation</lines>
<p>Java is a registered trademark of Oracle and/or its affiliates.</p>
</body>
</topic></required-cleanup>
</body>
</topic><?Pub Caret -2?>
<?Pub *0000016858?>
