X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fio%2FAbstractXMLObjectUnmarshaller.cpp;h=797b035dfdc23b91887bdd4a2ef0c1187c4d02b9;hb=f1c2df305292c1ef230d3fb2ada3787ffcd8421e;hp=701494b7a6b426e58892ecee3b7fed8408cc0ee7;hpb=39a84934370e6f68171b6769228f880abbae7243;p=shibboleth%2Fxmltooling.git diff --git a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp index 701494b..797b035 100644 --- a/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectUnmarshaller.cpp @@ -43,6 +43,11 @@ XMLObject* AbstractXMLObjectUnmarshaller::unmarshall(DOMElement* element, bool b xmltooling::NDC ndc("unmarshall"); #endif + if (!XMLString::equals(element->getNamespaceURI(),getElementQName().getNamespaceURI()) || + !XMLString::equals(element->getLocalName(),getElementQName().getLocalPart())) { + throw UnmarshallingException("Unrecognized element supplied to implementation for unmarshalling."); + } + if (XT_log.isDebugEnabled()) { auto_ptr_char dname(element->getNodeName()); XT_log.debug("unmarshalling DOM element (%s)", dname.get()); @@ -159,8 +164,7 @@ void AbstractXMLObjectUnmarshaller::unmarshallChildElements(const DOMElement* do } // Retain ownership of the unmarshalled child until it's processed by the parent. - auto_ptr childObject(builder->buildObject(static_cast(childNode))); - childObject->unmarshall(static_cast(childNode)); + auto_ptr childObject(builder->buildFromElement(static_cast(childNode))); processChildElement(childObject.get(), static_cast(childNode)); childObject.release(); }