Xerces 3 revisions.
[shibboleth/cpp-xmltooling.git] / xmltooling / base.h
index e1c7199..30db50d 100644 (file)
 # define XMLTOOLING_NO_XMLSEC 1\r
 #endif\r
 \r
+#ifdef XMLTOOLING_NO_XMLSEC\r
+# ifdef XMLTOOLING_XERCESC_64BITSAFE\r
+#   include <xercesc/util/XercesDefs.hpp>\r
+    typedef XMLSize_t xsecsize_t;\r
+# else\r
+    typedef unsigned int xsecsize_t;\r
+# endif\r
+#endif\r
+\r
 // Windows and GCC4 Symbol Visibility Macros\r
 #ifdef WIN32\r
   #define XMLTOOL_IMPORT __declspec(dllimport)\r
         domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, qstr.get()); \\r
     }\r
 \r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
+/**\r
+ * Implements marshalling for an ID attribute\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 MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \\r
+    if (m_##proper && *m_##proper) { \\r
+        domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \\r
+        domElement->setIdAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, true); \\r
+    }\r
+#else\r
 /**\r
  * Implements marshalling for an ID attribute\r
  *\r
  * @param ucase         the upcased name of the attribute\r
  * @param namespaceURI  the XML namespace of the attribute\r
  */\r
-#define MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \\r
+# define MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \\r
     if (m_##proper && *m_##proper) { \\r
         domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \\r
         domElement->setIdAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \\r
     }\r
+#endif\r
 \r
 /**\r
  * Implements unmarshalling process branch for a string attribute\r
         return; \\r
     }\r
 \r
+#ifdef XMLTOOLING_XERCESC_BOOLSETIDATTRIBUTE\r
 /**\r
  * Implements unmarshalling process branch for an ID attribute\r
  *\r
  * @param ucase         the upcased name of the attribute\r
  * @param namespaceURI  the XML namespace of the attribute\r
  */\r
-#define PROC_ID_ATTRIB(proper,ucase,namespaceURI) \\r
+# define PROC_ID_ATTRIB(proper,ucase,namespaceURI) \\r
+    if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \\r
+        set##proper(attribute->getValue()); \\r
+        attribute->getOwnerElement()->setIdAttributeNode(attribute, true); \\r
+        return; \\r
+    }\r
+#else\r
+/**\r
+ * Implements unmarshalling process branch for an ID attribute\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 PROC_ID_ATTRIB(proper,ucase,namespaceURI) \\r
     if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \\r
         set##proper(attribute->getValue()); \\r
         attribute->getOwnerElement()->setIdAttributeNode(attribute); \\r
         return; \\r
     }\r
+#endif\r
 \r
 /**\r
  * Implements unmarshalling process branch for a DateTime attribute\r
     { \\r
     public: \\r
         virtual ~cname##Impl() {} \\r
-        cname##Impl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) \\r
+        cname##Impl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) \\r
             : xmltooling::AbstractXMLObject(nsURI, localName, prefix, schemaType) { \\r
         } \\r
         cname##Impl(const cname##Impl& src) \\r
  */\r
 #define IMPL_XMLOBJECTBUILDER(cname) \\r
     cname* cname##Builder::buildObject( \\r
-        const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \\r
+        const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType \\r
         ) const \\r
     { \\r
         return new cname##Impl(nsURI,localName,prefix,schemaType); \\r
  */\r
 #define IMPL_XMLOBJECTBUILDER(cname) \\r
     xmltooling::XMLObject* cname##Builder::buildObject( \\r
-        const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \\r
+        const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::Name* schemaType \\r
         ) const \\r
     { \\r
         return new cname##Impl(nsURI,localName,prefix,schemaType); \\r