http://www.tireme.fr/xs2dtd/xs2DTDHandler
Contents
Managing imports for the need of comment elements
Tracking information from original schema
xs2dtd — Root of the structure, including n schema2dtd structures
<xs:element name="xs2dtd"><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element ref="nsDefs"> </xs:element><xs:element maxOccurs="unbounded" ref="xs2dtdHandler"> </xs:element></xs:sequence>
nsDefs — Global definitions of all used namespaces
<xs:element name="nsDefs"><xs:complexType mixed="false"></xs:element><xs:sequence maxOccurs="unbounded"></xs:complexType><xs:element ref="nsDef"> </xs:element></xs:sequence>
nsDef — Namespace/prefix declaration
xs2dtdHandler — structure handling information from a Schema : contains only parameter entity definitions and element declaration
| Name | Type | Use | Default val. | Facets |
| handlerId | xs:ID | optional | ||
| type | Enumerated values: main | include | import |
<xs:element name="xs2dtdHandler"><xs:complexType mixed="false"></xs:element><xs:sequence><xs:element minOccurs="0" ref="globalProperties"> </xs:element><xs:element ref="declarations"> </xs:element></xs:sequence><xs:attribute name="handlerId" type="xs:ID" use="optional"/><xs:attribute name="type"></xs:complexType><xs:simpleType></xs:attribute><xs:restriction base="xs:string"></xs:simpleType><xs:enumeration value="main"/><xs:enumeration value="include"/><xs:enumeration value="import"/></xs:restriction>
globalProperties — Properties for the main structure
<xs:element name="globalProperties"><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element ref="xsProperties"> </xs:element><xs:element minOccurs="0" ref="sdProperties"> </xs:element></xs:sequence>
xsProperties — Properties extracted from XML Schema file relevant to the xs namespace itself
<xs:element name="xsProperties"><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element ref="xsFileProperties"> </xs:element><xs:choice><xs:element ref="targetNamespace"> </xs:element><xs:element ref="noTargetNamespace"> </xs:element></xs:choice><xs:element ref="qualificationScope"> </xs:element></xs:sequence>
targetNamespace — TargetNamespace : value must be found in one nsDef element
noTargetNamespace — The schema has no target namespace
qualificationScope — Misc informations about qualification (elemFormDefault, attributeFormDefault)
sdProperties — Properties extracted from XML Schema file relevant to the SchemaDoc namespace
<xs:element name="sdProperties"><xs:complexType mixed="false"></xs:element><xs:sequence maxOccurs="unbounded"></xs:complexType><xs:element ref="sdProperty"> </xs:element></xs:sequence>
sdProperty — Generic SchemaDoc property management
declarations — All declarations : parameter entities and element declarations, comment -from xs annotation- may be found.
<xs:element name="declarations"><xs:complexType mixed="false"></xs:element><xs:choice maxOccurs="unbounded"></xs:complexType><xs:element ref="peDef"> </xs:element><xs:element ref="elementDecl"> </xs:element><xs:element ref="attributesDecl"> </xs:element><xs:element ref="peRef"> </xs:element><xs:element ref="comment"> </xs:element><xs:element ref="notation"> </xs:element></xs:choice>
peDef — Parameter Entity declaration. May be a simple content model (from simpleType), a complex content model (from complexType, group), attributes declarations (complexType, attribute, attributeGroup)
Type: peType
peType — parameterEntities
<xs:complexType mixed="false" name="peType"><xs:sequence></xs:complexType><xs:element ref="qName"> </xs:element><xs:element minOccurs="0" ref="comment"> </xs:element><xs:element maxOccurs="unbounded" minOccurs="0" ref="schemaOrigin"> </xs:element><xs:choice minOccurs="0"></xs:sequence><xs:element ref="externalRef"> </xs:element><xs:element ref="contentModel"> </xs:element><xs:element ref="attributes"> </xs:element><xs:element ref="attributeTypeContent"> </xs:element></xs:choice>
elementDecl — element declaration
<xs:element name="elementDecl"><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element ref="qName"> </xs:element><xs:element maxOccurs="unbounded" minOccurs="0" ref="schemaOrigin"> </xs:element><xs:element minOccurs="0" ref="comment"> </xs:element><xs:element ref="contentModel"> </xs:element><xs:element minOccurs="0" ref="attributes"> </xs:element></xs:sequence>
attributesDecl — case of complex type redefinition, a new attribute is defined. In this cas, it generates a peDef and an attribute declaration -for an elemRef- with a peRef. The attributes decl refers to an element declared somewhere (referenced by elementRef)
<xs:element name="attributesDecl"><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element ref="elementRef"> </xs:element><xs:element maxOccurs="unbounded" minOccurs="0" ref="schemaOrigin"> </xs:element><xs:element ref="attributes"> </xs:element></xs:sequence>
publicEntitySetName — Reference to a public declared name, in the case where inclusion is not managed by xs2dtd
qName — qualified name : namespace, localName
Type: qNameType
qNameType — qualified name (namespace and local name)
comment — comment : may include any XSD structure, and particulary : xs:annotation elements and original xs structures (complexTypes, simpleTypes, ect...)
<xs:element name="comment"><xs:complexType mixed="false"></xs:element><xs:choice maxOccurs="unbounded"></xs:complexType><xs:any maxOccurs="1" minOccurs="1" namespace="http://www.w3.org/2001/XMLSchema" processContents="strict"/><xs:element minOccurs="0" ref="lostFacets"> </xs:element><xs:element ref="para"> </xs:element><xs:element ref="initialContentModel"> </xs:element><xs:element ref="contentModelMadeEMPTY"> </xs:element><xs:element ref="contentModelMadeANY"> </xs:element><xs:element ref="usedInOtherEntitySet"> </xs:element></xs:choice>
lostFacets — Defines all facets that are contained within the declaration and lost
<xs:element name="lostFacets"><xs:complexType mixed="false"></xs:element><xs:sequence maxOccurs="unbounded"></xs:complexType><xs:element ref="lostFacet"> </xs:element></xs:sequence>
contentModelMadeEMPTY — Generated as soon as the content model was emptied and replaced by EMPTY
contentModelMadeANY — Generated as soon as the content model was emptied and replaced by ANY
lostFacet — One specific lost facet.
| Name | Type | Use | Default val. | Facets |
| type | xs:string | required | ||
| value | xs:string | required |
<xs:element name="lostFacet"><xs:complexType mixed="false"></xs:element><xs:simpleContent></xs:complexType><xs:extension base="xs:string"></xs:simpleContent><xs:attribute name="type" type="xs:string" use="required"/><xs:attribute name="value" type="xs:string" use="required"/></xs:extension>
initialContentModel — Store the original content model as soon as it has been modified by xs2dtd.
usedInOtherEntitySet — Generated as soon as an entity declaration has references in other entity sets and which location could not be resolved by the re-ordering mechanisms
contentModelType — content model :
<xs:complexType mixed="false" name="contentModelType"><xs:choice></xs:complexType><xs:element name="EMPTY"/><xs:element name="ANY"/><xs:element name="mixed"><xs:complexType mixed="false"></xs:element><xs:choice maxOccurs="unbounded" minOccurs="0"></xs:complexType><xs:element ref="elementRef"> </xs:element><xs:element ref="peRef"> </xs:element></xs:choice><xs:element name="children"><xs:complexType mixed="false"></xs:element><xs:choice></xs:complexType><xs:element maxOccurs="unbounded" ref="choice"> </xs:element><xs:element maxOccurs="unbounded" ref="sequence"> </xs:element><xs:element ref="peRef"> </xs:element></xs:choice><xs:element ref="peRef"> </xs:element></xs:choice>
choice — choice of elements
sequence — sequence of elements
Type: nestedParticleType
nestedParticleType — all information that may appear within a choice or a sequence
<xs:complexType mixed="false" name="nestedParticleType"><xs:choice maxOccurs="unbounded"><xs:element ref="elementRef"> </xs:element><xs:element ref="peRef"> </xs:element><xs:element ref="choice"> </xs:element><xs:element ref="sequence"> </xs:element></xs:choice><xs:attributeGroup ref="occurrence"> </xs:attributeGroup></xs:complexType>
nestedParticle4MixedType — information used for mixed content. only choice structure can be found. a complementary test must check that peRef used in sub-structure refers to "choice content model' peDef elements
Type: nestedParticleType
<xs:complexType mixed="false" name="nestedParticle4MixedType"><xs:complexContent></xs:complexType><xs:restriction base="nestedParticleType"></xs:complexContent><xs:choice maxOccurs="unbounded"></xs:restriction><xs:element ref="elementRef"> </xs:element><xs:element ref="peRef"> </xs:element><xs:element ref="choice"> </xs:element></xs:choice>
occurrence —
| Name | Type | Use | Default val. | Facets |
| occurrence | optional | Enumerated values: optional | oneOrPlus | zeroOrPlus |
<xs:attributeGroup name="occurrence"><xs:attribute name="occurrence" use="optional"></xs:attributeGroup><xs:simpleType></xs:attribute><xs:restriction base="xs:string"></xs:simpleType><xs:enumeration value="optional"/><xs:enumeration value="oneOrPlus"/><xs:enumeration value="zeroOrPlus"/></xs:restriction>
attributes — List of attribute declarations : related to parent elementDecl, includes peRef (to attributePeType peDef) and/or local declared attributes
Type: attributesType
attributeType — an attribute
<xs:complexType mixed="false" name="attributeType"><xs:sequence></xs:complexType><xs:element ref="qName"> </xs:element><xs:choice></xs:sequence><xs:group ref="attributeTypeContent"> </xs:group><xs:element ref="peRef"> </xs:element></xs:choice>
attributeTypeContent —
<xs:element name="attributeTypeContent"><xs:complexType mixed="false"></xs:element><xs:group ref="attributeTypeContent"> </xs:group></xs:complexType>
attributeTypeContent — patt: definition of the type of an attribute
<xs:group name="attributeTypeContent"><xs:sequence></xs:group><xs:element name="dtd"><xs:complexType mixed="false"></xs:element><xs:choice></xs:complexType><xs:element name="ID"/><xs:element name="IDREF"/><xs:element name="IDREFS"/><xs:element name="NMTOKEN"/><xs:element name="NMTOKENS"/><xs:element name="ENTITY"/><xs:element name="ENTITIES"/><xs:element name="NOTATION"/><xs:element name="CDATA"/><xs:element name="enum"></xs:choice><xs:complexType mixed="false"></xs:element><xs:sequence></xs:complexType><xs:element maxOccurs="unbounded" name="enumItem" type="xs:string"/></xs:sequence><xs:element minOccurs="0" name="use"><xs:complexType mixed="false"></xs:element><xs:attribute default="REQUIRED" name="kind"></xs:complexType><xs:simpleType></xs:attribute><xs:restriction base="xs:string"></xs:simpleType><xs:enumeration value="REQUIRED"/><xs:enumeration value="IMPLIED"/><xs:enumeration value="FIXED"/></xs:restriction><xs:choice minOccurs="0"><xs:element name="default" type="xs:string"/><xs:element name="fixed" type="xs:string"/></xs:choice><xs:element minOccurs="0" ref="comment"> </xs:element></xs:sequence>
externalPeType — external parameter entity ; patt: ajout d'un attribut pour appeler l'entité paramètre au moment de sa déclaration (à voir plus tard)
Type: peType
| Name | Type | Use | Default val. | Facets |
| callHere | xs:boolean | true | ||
| sourceLocation | xs:string | required | ||
| sourceType | required | Enumerated values: include | import | redefine |
<xs:complexType mixed="false" name="externalPeType"><xs:complexContent></xs:complexType><xs:extension base="peType"></xs:complexContent><xs:sequence><xs:element ref="systemLocation"> </xs:element><xs:element ref="xs2DtdHandlerRef"> </xs:element></xs:sequence><xs:attribute name="sourceType" use="required"><xs:simpleType></xs:attribute><xs:restriction base="xs:string"></xs:simpleType><xs:enumeration value="include"/><xs:enumeration value="import"/><xs:enumeration value="redefine"/></xs:restriction><xs:attribute name="sourceLocation" type="xs:string" use="required"/><xs:attribute default="true" name="callHere" type="xs:boolean"/></xs:extension>
contentModelPeType — internal parameter entity containig content model definition
Type: peType
attributePeType — internal parameter entity containig attribute definitions
Type: peType
attributeContentPEType — patt: internal parameter entity containing attribute type
Type: peType
externalRef — Reference to an external entity
<xs:element name="externalRef"><xs:complexType mixed="false"></xs:element><xs:choice></xs:complexType><xs:element ref="xs2DtdHandlerRef"> </xs:element><xs:sequence></xs:choice><xs:element ref="systemLocation"> </xs:element><xs:element minOccurs="0" ref="publicEntitySetName"> </xs:element></xs:sequence>
peRef — reference to a peDef
Type: qNameType
| Name | Type | Use | Default val. | Facets |
| id | xs:ID | optional | ||
| idref | xs:IDREFS | optional | ||
| (Group) occurrence | ||||
| suspiciousLocalName | xs:boolean | optional | ||
<xs:element name="peRef"><xs:complexType mixed="false"></xs:element><xs:complexContent></xs:complexType><xs:extension base="qNameType"></xs:complexContent><xs:attributeGroup ref="occurrence"> </xs:attributeGroup><xs:attribute name="idref" type="xs:IDREFS" use="optional"/><xs:attribute name="id" type="xs:ID" use="optional"/><xs:attribute name="suspiciousLocalName" type="xs:boolean" use="optional"/></xs:extension>
elementRef — Reference to an element definition
Type: qNameType
<xs:element name="elementRef"><xs:complexType mixed="false"></xs:element><xs:complexContent></xs:complexType><xs:extension base="qNameType"></xs:complexContent><xs:attributeGroup ref="occurrence"> </xs:attributeGroup><xs:attribute name="idref" type="xs:IDREF"/></xs:extension>
xs2DtdHandlerRef — reference to the imported/included xs2dtdHandler
schemaOrigin — link to the schema original element