Add xsi:nil support to objects.
[shibboleth/xmltooling.git] / xmltooling / AbstractXMLObject.h
index 80b2971..7767167 100644 (file)
 #ifndef __xmltooling_abstractxmlobj_h__
 #define __xmltooling_abstractxmlobj_h__
 
+#include <xmltooling/logging.h>
 #include <xmltooling/XMLObject.h>
 #include <xmltooling/util/DateTime.h>
 
-#include <log4cpp/Category.hh>
-
 #if defined (_MSC_VER)
     #pragma warning( push )
     #pragma warning( disable : 4250 4251 )
@@ -80,7 +79,18 @@ namespace xmltooling {
         const XMLCh* getXMLID() const {
             return NULL;
         }
-    
+        
+        xmlconstants::xmltooling_bool_t getNil() const {
+               return m_nil;
+        }
+        
+        void nil(xmlconstants::xmltooling_bool_t value) {
+            if (m_nil != value) {
+               releaseThisandParentDOM();
+               m_nil = value;
+            }
+        }
+
         bool hasParent() const {
             return m_parent != NULL;
         }
@@ -195,7 +205,7 @@ namespace xmltooling {
         /**
          * Logging object.
          */
-        log4cpp::Category& m_log;
+        logging::Category& m_log;
 
         /**
          * Stores off xsi:schemaLocation attribute.
@@ -206,6 +216,11 @@ namespace xmltooling {
          * Stores off xsi:noNamespaceSchemaLocation attribute.
          */
         XMLCh* m_noNamespaceSchemaLocation;
+        
+        /**
+         * Stores off xsi:nil attribute.
+         */
+        xmlconstants::xmltooling_bool_t m_nil;
 
     private:
         XMLObject* m_parent;