https://issues.shibboleth.net/jira/browse/CPPXT-45
authorScott Cantor <cantor.2@osu.edu>
Fri, 16 Oct 2009 02:11:38 +0000 (02:11 +0000)
committerScott Cantor <cantor.2@osu.edu>
Fri, 16 Oct 2009 02:11:38 +0000 (02:11 +0000)
xmltooling/base.h
xmltooling/encryption/impl/EncryptionImpl.cpp
xmltooling/signature/impl/KeyInfoImpl.cpp

index 827213a..6d4915d 100644 (file)
     }\r
 \r
 /**\r
+ * Implements get/set methods and a private member for a string XML attribute,\r
+ * plus a getXMLID override and attribute node clearance when DOM is dropped.\r
+ *\r
+ * @param proper    the proper name of the attribute\r
+ * @param ucase         the upcased name of the attribute\r
+ * @param namespaceURI  the XML namespace of the attribute\r
+ */\r
+#define IMPL_ID_ATTRIB_EX(proper, ucase, namespaceURI) \\r
+    IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \\r
+    const XMLCh* getXMLID() const { \\r
+        return m_##proper; \\r
+    } \\r
+    void releaseDOM() const { \\r
+        if (getDOM()) \\r
+            getDOM()->removeAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \\r
+        AbstractDOMCachingXMLObject::releaseDOM(); \\r
+    }\r
+\r
+/**\r
  * Implements get/set methods and a private member for a DateTime XML attribute.\r
  *\r
  * @param proper    the proper name of the attribute\r
index df2eda0..6843b4a 100644 (file)
@@ -17,7 +17,7 @@
 /**
  * EncryptionImpl.cpp
  * 
- * Implementation classes for XML Encryption schema
+ * Implementation classes for XML Encryption schema.
  */
 
 #include "internal.h"
@@ -284,7 +284,7 @@ namespace xmlencryption {
         }
         
         IMPL_XMLOBJECT_CLONE(EncryptionProperty);
-        IMPL_ID_ATTRIB(Id);
+        IMPL_ID_ATTRIB_EX(Id,ID,NULL);
         IMPL_STRING_ATTRIB(Target);
         IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
 
@@ -351,7 +351,7 @@ namespace xmlencryption {
         }
         
         IMPL_XMLOBJECT_CLONE(EncryptionProperties);
-        IMPL_ID_ATTRIB(Id);
+        IMPL_ID_ATTRIB_EX(Id,ID,NULL);
         IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end());
 
     protected:
@@ -559,7 +559,7 @@ namespace xmlencryption {
         }
         
         IMPL_XMLOBJECT_CLONE(EncryptedType);
-        IMPL_ID_ATTRIB(Id);
+        IMPL_ID_ATTRIB_EX(Id,ID,NULL);
         IMPL_STRING_ATTRIB(Type);
         IMPL_STRING_ATTRIB(MimeType);
         IMPL_STRING_ATTRIB(Encoding);
index 9505365..d580130 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
 /**
  * KeyInfoImpl.cpp
  * 
- * Implementation classes for KeyInfo schema
+ * Implementation classes for KeyInfo schema.
  */
 
 #include "internal.h"
@@ -696,7 +696,7 @@ namespace xmlsignature {
         }
         
         IMPL_XMLOBJECT_CLONE(KeyInfo);
-        IMPL_ID_ATTRIB(Id);
+        IMPL_ID_ATTRIB_EX(Id,ID,NULL);
         IMPL_TYPED_CHILDREN(KeyName,m_children.end());
         IMPL_TYPED_CHILDREN(KeyValue,m_children.end());
         IMPL_TYPED_CHILDREN(RetrievalMethod,m_children.end());