All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.xmlmiddleware.xmldbms.maps.utils.DTDGenerator
This class generates a DTD object capable of representing documents that can use the map. The DTD is generated as follows:
For each ClassMap, an element type is generated. If a ClassMap does not have a property map for PCDATA but does have property maps, related class maps, or inline maps for child elements, the content model is a sequence. Otherwise, empty, mixed, or PCDATA-only content models are used as appropriate.
For each PropertyMap for a child element, a reference to that element type is added to the content model. If the PropertyMap uses a property table, the * modifier is added to the reference.
For each PropertyMap for an attribute, an attribute is created. The type is CDATA unless the TokenList attribute is of the PropertyMap is set, in which case the type is NMTOKENS.
For each PropertyMap for PCDATA, PCDATA is added to the content model. If the content model also contains element references, it is made into a mixed content model.
The ContainsXML attribute of PropertyMap cannot be handled correctly, as there is no way to know what children the referenced element type has.
For each InlineMap, a reference to the inlined element type is added to the content model. The element type is then processed under the same rules as element types mapped using ClassMap.
For each RelatedClass, a reference to the element type is added to the content model. If the unique key is in the parent, the * modifier is added to the reference.
FixedOrder, when present, is used to specify the order of references to child elements in the content model.
Extends and UseClassMap cause exceptions to be thrown, as these model structures not handled by DTDs.
public DTDGenerator()
public DTD getDTD(XMLDBMSMap map) throws XMLMiddlewareException
All Packages Class Hierarchy This Package Previous Next Index