X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=blobdiff_plain;f=xmltooling%2Fio%2FAbstractXMLObjectMarshaller.cpp;fp=xmltooling%2Fio%2FAbstractXMLObjectMarshaller.cpp;h=622240dbc18eb99af2074ccb91c9f3a5a145e647;hp=0c87aff42168c53f30584efaf5c4257603fde9f6;hb=ebb2772c2c65d4fe6f52e7978b9c7f656829614e;hpb=862161ef6283127928bd9307e1a184bf2ea0a6c8 diff --git a/xmltooling/io/AbstractXMLObjectMarshaller.cpp b/xmltooling/io/AbstractXMLObjectMarshaller.cpp index 0c87aff..622240d 100644 --- a/xmltooling/io/AbstractXMLObjectMarshaller.cpp +++ b/xmltooling/io/AbstractXMLObjectMarshaller.cpp @@ -192,6 +192,27 @@ void AbstractXMLObjectMarshaller::marshallInto( targetElement->setAttributeNS(XSI_NS,noNamespaceSchemaLocation,m_noNamespaceSchemaLocation); } } + + static const XMLCh _nil[] = { chLatin_x, chLatin_s, chLatin_i, chColon, chLatin_n, chLatin_i, chLatin_l, chNull }; + + if (m_nil != xmlconstants::XML_BOOL_NULL) { + switch (m_nil) { + case xmlconstants::XML_BOOL_TRUE: + targetElement->setAttributeNS(XSI_NS, _nil, xmlconstants::XML_TRUE); + break; + case xmlconstants::XML_BOOL_ONE: + targetElement->setAttributeNS(XSI_NS, _nil, xmlconstants::XML_ONE); + break; + case xmlconstants::XML_BOOL_FALSE: + targetElement->setAttributeNS(XSI_NS, _nil, xmlconstants::XML_FALSE); + break; + case xmlconstants::XML_BOOL_ZERO: + targetElement->setAttributeNS(XSI_NS, _nil, xmlconstants::XML_ZERO); + break; + } + m_log.debug("adding XSI namespace to list of namespaces used by XMLObject"); + addNamespace(Namespace(XSI_NS, XSI_PREFIX)); + } marshallElementType(targetElement); marshallNamespaces(targetElement);