Began to implement collection handling.
[shibboleth/xmltooling.git] / xmltooling / io / AbstractXMLObjectMarshaller.cpp
index 65bc509..42a4080 100644 (file)
@@ -283,6 +283,8 @@ class _marshallchild : public binary_function<XMLObject*,DOMElement*,void> {
 public:\r
     _marshallchild(void* log) : m_log(log) {}\r
     void operator()(XMLObject* obj, DOMElement* element) const {\r
+        if (!obj)\r
+            return;\r
         if (XT_log.isDebugEnabled()) {\r
             XT_log.debug("getting marshaller for child XMLObject: %s", obj->getElementQName().toString().c_str());\r
         }\r
@@ -303,8 +305,6 @@ void AbstractXMLObjectMarshaller::marshallChildElements(const XMLObject& xmlObje
 {\r
     XT_log.debug("marshalling child elements for XMLObject");\r
 \r
-    vector<XMLObject*> children;\r
-    if (xmlObject.getOrderedChildren(children)) {\r
-        for_each(children.begin(),children.end(),bind2nd(_marshallchild(m_log),domElement));\r
-    }\r
+    const list<XMLObject*>& children=xmlObject.getOrderedChildren();\r
+    for_each(children.begin(),children.end(),bind2nd(_marshallchild(m_log),domElement));\r
 }\r