2002-06-21 13:16:28 +02:00
|
|
|
#ifndef JEZUK_SAX2DOM_DOCUMENTTYPEIMPL_H
|
|
|
|
#define JEZUK_SAX2DOM_DOCUMENTTYPEIMPL_H
|
|
|
|
|
|
|
|
#include <DOM/Simple/DocumentTypeImpl.h>
|
|
|
|
|
|
|
|
namespace SAX2DOM
|
|
|
|
{
|
|
|
|
|
|
|
|
template<class stringT, class string_adaptorT>
|
|
|
|
class DocumentType : public SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT>
|
|
|
|
{
|
|
|
|
typedef SimpleDOM::DocumentTypeImpl<stringT, string_adaptorT> 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<stringT, string_adaptorT>* entity)
|
|
|
|
{
|
|
|
|
BaseDT::addEntity(entity);
|
|
|
|
} // addEntity
|
|
|
|
|
|
|
|
void addNotation(SimpleDOM::NotationImpl<stringT, string_adaptorT>* notation)
|
|
|
|
{
|
|
|
|
BaseDT::addNotation(notation);
|
|
|
|
} // addNotation
|
|
|
|
|
|
|
|
void addElement(SimpleDOM::ElementImpl<stringT, string_adaptorT>* element)
|
|
|
|
{
|
|
|
|
BaseDT::addElement(element);
|
|
|
|
} // addElement
|
|
|
|
|
|
|
|
void addDefaultAttr(const stringT& elementName, const stringT& attributeName, const stringT& attributeValue)
|
|
|
|
{
|
2004-09-18 01:17:51 +02:00
|
|
|
SimpleDOM::ElementImpl<stringT, string_adaptorT>* elem = dynamic_cast<SimpleDOM::ElementImpl<stringT, string_adaptorT>*>(BaseDT::getElements()->getNamedItem(elementName));
|
2004-01-28 22:39:33 +01:00
|
|
|
if(elem == 0)
|
|
|
|
{
|
|
|
|
elem = new SimpleDOM::ElementImpl<stringT, string_adaptorT>(0, elementName);
|
|
|
|
addElement(elem);
|
|
|
|
}
|
2004-09-18 01:17:51 +02:00
|
|
|
SimpleDOM::AttrImpl<stringT, string_adaptorT>* attr = new SimpleDOM::AttrImpl<stringT, string_adaptorT>(BaseDT::ownerDoc_, attributeName);
|
2002-06-21 13:16:28 +02:00
|
|
|
attr->setValue(attributeValue);
|
|
|
|
attr->setSpecified(false);
|
|
|
|
elem->setAttributeNode(attr);
|
|
|
|
} // addDefaultAttr
|
|
|
|
|
|
|
|
void addElementId(const stringT& elementName)
|
|
|
|
{
|
|
|
|
BaseDT::addElementId(elementName);
|
|
|
|
} // addElementId
|
|
|
|
}; // class DOMImplementation
|
|
|
|
|
|
|
|
} // namespace SAX2DOM
|
|
|
|
|
|
|
|
#endif
|
2002-11-23 21:03:54 +01:00
|
|
|
// end of file
|