marshallElementType(targetElement);\r
marshallNamespaces(targetElement);\r
marshallAttributes(targetElement);\r
- marshallChildElements(targetElement);\r
- marshallElementContent(targetElement);\r
+ marshallContent(targetElement);\r
\r
#ifndef XMLTOOLING_NO_XMLSEC\r
if (sigs) {\r
for_each(namespaces.begin(),namespaces.end(),bind1st(_addns(),domElement));\r
}\r
\r
-class _marshallit : public binary_function<const XMLObject*,DOMElement*,void> {\r
-public:\r
- void operator()(const XMLObject* xo, DOMElement* e) const {\r
- if (xo) xo->marshall(e);\r
- }\r
-};\r
-\r
-void AbstractXMLObjectMarshaller::marshallChildElements(DOMElement* domElement) const\r
+void AbstractXMLObjectMarshaller::marshallContent(DOMElement* domElement) const\r
{\r
- XT_log.debug("marshalling child elements for XMLObject");\r
-\r
+ XT_log.debug("marshalling text and child elements for XMLObject");\r
+ \r
+ const XMLCh* val;\r
+ unsigned int pos=0;\r
const list<XMLObject*>& children=getOrderedChildren();\r
- for_each(children.begin(),children.end(),bind2nd(_marshallit(),domElement));\r
+ for (list<XMLObject*>::const_iterator i=children.begin(); i!=children.end(); ++i, ++pos) {\r
+ val = getTextContent(pos);\r
+ if (val && *val)\r
+ domElement->appendChild(domElement->getOwnerDocument()->createTextNode(val));\r
+ if (*i)\r
+ (*i)->marshall(domElement);\r
+ }\r
+ val = getTextContent(pos);\r
+ if (val && *val)\r
+ domElement->appendChild(domElement->getOwnerDocument()->createTextNode(val));\r
}\r