#ifndef JEZUK_SAX2DOM_DOCUMENTTYPEIMPL_H #define JEZUK_SAX2DOM_DOCUMENTTYPEIMPL_H #include namespace SAX2DOM { template class DocumentType : public SimpleDOM::DocumentTypeImpl { typedef SimpleDOM::DocumentTypeImpl BaseDT; public: DocumentType(const stringT& qualifiedName, const stringT& publicId, const stringT& systemId) : BaseDT(qualifiedName, publicId, systemId) { } // DocumentType virtual ~DocumentType() { } ////////////////////////////////////////////////////// // DOM::DOMImplementation extensions void addEntity(SimpleDOM::EntityImpl* entity) { BaseDT::addEntity(entity); } // addEntity void addNotation(SimpleDOM::NotationImpl* notation) { BaseDT::addNotation(notation); } // addNotation void addElement(const stringT& name) { BaseDT::addElement(new SimpleDOM::ElementImpl(BaseDT::ownerDoc_, name)); } // addElement void addDefaultAttr(const stringT& elementName, const stringT& attributeName, const stringT& attributeValue) { SimpleDOM::ElementImpl* elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); if(elem == 0) { addElement(elementName); elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); } SimpleDOM::AttrImpl* attr = new SimpleDOM::AttrImpl(BaseDT::ownerDoc_, attributeName); attr->setValue(attributeValue); attr->setSpecified(false); elem->setAttributeNode(attr); } // addDefaultAttr void addElementId(const stringT& elementName) { BaseDT::addElementId(elementName); } // addElementId }; // class DOMImplementation } // namespace SAX2DOM #endif // end of file