<faq-map>
map type, do the following:faq-map/xsd
.faq-mapDomain/xsd
.faq-mapDomain/xsd/faq-mapDomain.xsd
with this content:<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="urn:oasis:names:tc:dita:xsd:xml.xsd:1.2"/> </xs:schema>
This file acts as the stub for the FAQ map map domain, which we will define in Step 2.
basemap.xsd
from the standard DITA schema distribution and copy it into the faq-map/xsd
directory and rename it to faq-map.xsd
.faq-map/faq-map-test-xsd-01.ditamap
with this content:<?xml version="1.0" encoding="UTF-8"?> <faq-map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/faq-map.xsd"> <title>FAQ Map Test 01</title> <topicmeta></topicmeta> <keydef keys="foo"/> <faq-question-set> <faq-question/> </faq-question-set> </faq-map>
Validate the document. It should complain that the element type <faq-map>
is not declared.
faq-map.xsd
.<!-- ============================================================= FAQ Map document type shell Copyright (c) 2010 Your Name Here ============================================================= --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"> <!-- ======= INCLUDE ======= --> ... </xs:schema>
... <xs:include schemaLocation="urn:oasis:names:tc:dita:xsd:mapMod.xsd:1.2" /> <xs:include schemaLocation="faq-mapMod.xsd" /> ...
@domains
attribute value:<xs:attributeGroup name="domains-att"> <xs:attribute name="domains" type="xs:string" default="(map faq-map faq-map-d) (map mapgroup-d) (topic indexing-d) (topic delay-d)"/> </xs:attributeGroup>
faq-map/xsd/faq-mapMod.xsd
with this content:<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"> </xs:schema>
faq-map.xsd
file.mapMod.xsd
from the standard DITA schema distribution. Find the comment "Import - XML Attributes and Namespaces" and copy it and the two imports following it into faq-mapMod.xsd
:<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"> <!-- ======= IMPORT - XML attributes and namespace ======= --> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="urn:oasis:names:tc:dita:xsd:xml.xsd:1.2"/> <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="urn:oasis:names:tc:dita:xsd:ditaarch.xsd:1.2"/> ... </xs:schema>
<xs:redefine>
element for mapGrp.xsd and add an include of faq-mapDomain.xsd
immediately before it:... <xs:include schemaLocation="../../faq-mapDomain/xsd/faq-mapDomain.xsd"/> <xs:redefine schemaLocation="urn:oasis:names:tc:dita:xsd:mapGrp.xsd:1.2"> ...
mapMod.xsd
find the declarations for the <map>
element type (they should all be together in the file) and copy them into faq-mapMod.xsd
.@class
attribute:<xs:element name="faq-map"> <xs:annotation> <xs:documentation> The <<keyword>faq-map</keyword>> element represents an FAQ publication. </xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="faq-map.class"> <xs:attribute ref="class" default="- map/map " /> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:complexType name="faq-map.class" > <xs:sequence> <xs:group ref="faq-map.content"/> </xs:sequence> <xs:attributeGroup ref="faq-map.attributes"/> </xs:complexType> <xs:group name="faq-map.content"> <xs:sequence> <xs:sequence> <xs:group ref="title" minOccurs="0" /> <xs:group ref="topicmeta" minOccurs="0" /> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:group ref="navref" /> <xs:group ref="anchor" /> <xs:group ref="topicref" /> <xs:group ref="reltable" /> <xs:group ref="data.elements.incl" /> </xs:choice> </xs:sequence> </xs:sequence> </xs:group> <xs:attributeGroup name="faq-map.attributes"> <xs:attribute name="title" type="xs:string" /> <xs:attribute name="id" type="xs:ID" /> <xs:attributeGroup ref="conref-atts" /> <xs:attribute name="anchorref" type="xs:string" /> <xs:attribute name="outputclass" type="xs:string" /> <xs:attributeGroup ref="domains-att"/> <xs:attributeGroup ref="topicref-atts" /> <xs:attributeGroup ref="select-atts" /> <xs:attributeGroup ref="localization-atts"/> <xs:attribute ref="ditaarch:DITAArchVersion"/> <xs:attributeGroup ref="global-atts" /> </xs:attributeGroup>
@class
attribute to "- map/map faq-map/faq-map ":<xs:element name="faq-map"> <xs:annotation> <xs:documentation> The <<keyword>faq-map</keyword>> element represents an FAQ publication. </xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="faq-map.class"> <xs:attribute ref="class" default="- map/map faq-map/faq-map " /> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element>
<xs:group name="faq-map.content"> <xs:sequence> <xs:sequence> <xs:group ref="title" minOccurs="0" /> <xs:group ref="topicmeta" minOccurs="0" /> <xs:group ref="keydef" minOccurs="0" maxOccurs="unbounded"/> <xs:group ref="faq-question-set" minOccurs="1" maxOccurs="1"/> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:group ref="reltable" /> </xs:choice> </xs:sequence> </xs:sequence> </xs:group>
At this point the FAQ-map map type document type shell and module is complete. Now we just need to define the FAQ-map map domain.