\r
Marshaller* Marshaller::m_default=NULL;\r
\r
-const Marshaller* Marshaller::getMarshaller(const DOMElement* domElement)\r
+const Marshaller* Marshaller::getMarshaller(const XMLObject* xmlObject)\r
{\r
#ifdef _DEBUG\r
xmltooling::NDC ndc("getMarshaller");\r
#endif\r
Category& log=Category::getInstance(XMLTOOLING_LOGCAT".Marshaller");\r
\r
- auto_ptr<QName> schemaType(XMLHelper::getXSIType(domElement));\r
- const Marshaller* m = getMarshaller(*(schemaType.get()));\r
+ const QName* type=xmlObject->getSchemaType();\r
+ const Marshaller* m = type ? getMarshaller(*type) : NULL;\r
if (m) {\r
if (log.isDebugEnabled()) {\r
- log.debug("Located Marshaller for schema type: %s", schemaType->toString().c_str());\r
+ log.debug("located Marshaller for schema type: %s", type->toString().c_str());\r
}\r
return m;\r
}\r
\r
- auto_ptr<QName> elementName(XMLHelper::getNodeQName(domElement));\r
- m = getMarshaller(*(elementName.get()));\r
+ m = getMarshaller(xmlObject->getElementQName());\r
if (m) {\r
if (log.isDebugEnabled()) {\r
- log.debug("Located Marshaller for element name: %s", elementName->toString().c_str());\r
+ log.debug("located Marshaller for element name: %s", xmlObject->getElementQName().toString().c_str());\r
}\r
return m;\r
}\r
\r
- log.error("No Marshaller was registered for element: %s", elementName->toString().c_str());\r
+ log.error("no Marshaller registered for element: %s", xmlObject->getElementQName().toString().c_str());\r
return NULL;\r
}\r
\r
* \r
* @throws MarshallingException thrown if there is a problem marshalling the given object\r
*/\r
- virtual DOMElement* marshall(XMLObject* xmlObject, DOMDocument* document) const=0;\r
+ virtual DOMElement* marshall(XMLObject* xmlObject, DOMDocument* document=NULL) const=0;\r
\r
/**\r
* Retrieves a Marshaller using the key it was registered with.\r
}\r
\r
/**\r
- * Retrieves a Marshaller for a DOM element\r
+ * Retrieves a Marshaller for an XML object\r
* \r
- * @param element the element for which to return a marshaller\r
+ * @param xmlObject the object for which to return a marshaller\r
* @return the marshaller or NULL\r
*/\r
- static const Marshaller* getMarshaller(const DOMElement* key);\r
+ static const Marshaller* getMarshaller(const XMLObject* xmlObject);\r
\r
/**\r
* Retrieves default Marshaller for DOM elements\r