https://issues.shibboleth.net/jira/browse/CPPXT-45
[shibboleth/cpp-opensaml.git] / saml / saml1 / core / impl / ProtocolsImpl.cpp
index 6d8bb4e..b99bab0 100644 (file)
 /**
  * ProtocolsImpl.cpp
  *
- * Implementation classes for SAML 1.x Protocols schema
+ * Implementation classes for SAML 1.x Protocols schema.
  */
 
 #include "internal.h"
 #include "exceptions.h"
 #include "saml1/core/Assertions.h"
 #include "saml1/core/Protocols.h"
+#include "signature/ContentReference.h"
 
 #include <xmltooling/AbstractComplexElement.h>
 #include <xmltooling/AbstractSimpleElement.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
+#include <xmltooling/signature/Signature.h>
+#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/XMLHelper.h>
 
 #include <ctime>
@@ -376,6 +379,11 @@ namespace opensaml {
             const XMLCh* getID() const {
                 return getRequestID();
             }
+            void releaseDOM() const {
+                if (getDOM())
+                    getDOM()->removeAttributeNS(NULL, REQUESTID_ATTRIB_NAME);
+                AbstractDOMCachingXMLObject::releaseDOM();
+            }
             IMPL_DATETIME_ATTRIB(IssueInstant,0);
             IMPL_TYPED_CHILDREN(RespondWith,m_pos_Signature);
 
@@ -390,7 +398,7 @@ namespace opensaml {
                     const_cast<RequestAbstractTypeImpl*>(this)->m_RequestID=SAMLConfig::getConfig().generateIdentifier();
                 domElement->setAttributeNS(NULL, REQUESTID_ATTRIB_NAME, m_RequestID);
                 if (*m_MinorVersion!=chDigit_0) {
-#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE
                     domElement->setIdAttributeNS(NULL, REQUESTID_ATTRIB_NAME, true);
 #else
                     domElement->setIdAttributeNS(NULL, REQUESTID_ATTRIB_NAME);
@@ -413,7 +421,7 @@ namespace opensaml {
                 // Standard processing, but then we check IDness.
                 AbstractXMLObjectUnmarshaller::unmarshallAttributes(domElement);
                 if (m_RequestID && (!m_MinorVersion || *m_MinorVersion!=chDigit_0)) {
-#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE
                     const_cast<DOMElement*>(domElement)->setIdAttributeNS(NULL, REQUESTID_ATTRIB_NAME, true);
 #else
                     const_cast<DOMElement*>(domElement)->setIdAttributeNS(NULL, REQUESTID_ATTRIB_NAME);
@@ -714,6 +722,11 @@ namespace opensaml {
             const XMLCh* getID() const {
                 return getResponseID();
             }
+            void releaseDOM() const {
+                if (getDOM())
+                    getDOM()->removeAttributeNS(NULL, RESPONSEID_ATTRIB_NAME);
+                AbstractDOMCachingXMLObject::releaseDOM();
+            }
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_DATETIME_ATTRIB(IssueInstant,0);
             IMPL_STRING_ATTRIB(Recipient);
@@ -729,7 +742,7 @@ namespace opensaml {
                     const_cast<ResponseAbstractTypeImpl*>(this)->m_ResponseID=SAMLConfig::getConfig().generateIdentifier();
                 domElement->setAttributeNS(NULL, RESPONSEID_ATTRIB_NAME, m_ResponseID);
                 if (*m_MinorVersion!=chDigit_0) {
-#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE
                     domElement->setIdAttributeNS(NULL, RESPONSEID_ATTRIB_NAME, true);
 #else
                     domElement->setIdAttributeNS(NULL, RESPONSEID_ATTRIB_NAME);
@@ -753,7 +766,7 @@ namespace opensaml {
                 // Standard processing, but then we check IDness.
                 AbstractXMLObjectUnmarshaller::unmarshallAttributes(domElement);
                 if (m_ResponseID && (!m_MinorVersion || *m_MinorVersion!=chDigit_0)) {
-#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE
                     const_cast<DOMElement*>(domElement)->setIdAttributeNS(NULL, RESPONSEID_ATTRIB_NAME, true);
 #else
                     const_cast<DOMElement*>(domElement)->setIdAttributeNS(NULL, RESPONSEID_ATTRIB_NAME);