/* Copyright 1996-2000 Simon Whiteside $Id: InheritsElement.cpp.txt,v 1.1 2007/09/18 11:41:38 sdw Exp $ */ #include "InheritsElement.h" #include "parsers/DOMParser.hpp" #include "framework/LocalFileInputSource.hpp" #include "skXMLErrorHandler.h" //------------------------------------------ InheritsElement::InheritsElement() //------------------------------------------ { } //------------------------------------------ InheritsElement::InheritsElement(const skString& location,DOM_Element elem) //------------------------------------------ : skXMLElementObject(location,elem) { replaceInherits(getElement()); } //------------------------------------------ skXMLElementObject * InheritsElement::createXMLElementObject(const skString& location,DOM_Element element) //------------------------------------------ { return new InheritsElement(location,element); } //------------------------------------------ void InheritsElement::setElement(DOM_Element elem) //------------------------------------------ { skXMLElementObject::setElement(elem); replaceInherits(elem); } //------------------------------------------ void InheritsElement::replaceInherits(DOM_Element elem) //------------------------------------------ { // go through the list of children looking for an tag. DOM_NodeList nodes=elem.getChildNodes(); int count=0; DOM_Document owner=elem.getOwnerDocument(); DOMString sInheritsTag("inherits"); for (int i=0;isetErrorHandler(&handler); parser->parse(in); DOM_Element parent=parser->getDocument().getDocumentElement(); delete parser; // check if this element has any inherits tags replaceInherits(parent); DOM_NodeList parent_nodes=parent.getChildNodes(); for (int j=0;j