Refined ElementProxy/ElementExtensible interfaces to match Java.
authorScott Cantor <cantor.2@osu.edu>
Mon, 27 Nov 2006 21:26:18 +0000 (21:26 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 27 Nov 2006 21:26:18 +0000 (21:26 +0000)
19 files changed:
xmltooling/AbstractElementProxy.h [deleted file]
xmltooling/AttributeExtensibleXMLObject.h
xmltooling/ElementExtensibleXMLObject.h [new file with mode: 0644]
xmltooling/ElementProxy.h
xmltooling/Makefile.am
xmltooling/encryption/Encryption.h
xmltooling/encryption/impl/Decrypter.cpp
xmltooling/encryption/impl/Encrypter.cpp
xmltooling/encryption/impl/EncryptionImpl.cpp
xmltooling/encryption/impl/EncryptionSchemaValidators.cpp
xmltooling/impl/AnyElement.cpp
xmltooling/impl/AnyElement.h
xmltooling/signature/KeyInfo.h
xmltooling/signature/impl/KeyInfoImpl.cpp
xmltooling/signature/impl/KeyInfoSchemaValidators.cpp
xmltooling/soap/SOAP.h
xmltooling/soap/impl/SOAPClient.cpp
xmltooling/soap/impl/SOAPImpl.cpp
xmltoolingtest/ComplexXMLObjectTest.h

diff --git a/xmltooling/AbstractElementProxy.h b/xmltooling/AbstractElementProxy.h
deleted file mode 100644 (file)
index 473a942..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  Copyright 2001-2006 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file xmltooling/AbstractElementProxy.h
- * 
- * AbstractXMLObject mixin that implements an open content model 
- */
-
-#ifndef __xmltooling_abseleproxy_h__
-#define __xmltooling_abseleproxy_h__
-
-#include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/ElementProxy.h>
-
-#if defined (_MSC_VER)
-    #pragma warning( push )
-    #pragma warning( disable : 4250 4251 )
-#endif
-
-namespace xmltooling {
-
-    /**
-     * AbstractXMLObject mixin that layers ElementProxy on top of a complex element.
-     * Inherit from this class to implement complex content
-     * and expose the underlying child collection in read/write mode.
-     */
-    class XMLTOOL_API AbstractElementProxy : public virtual ElementProxy, public AbstractComplexElement
-    {
-    public:
-        virtual ~AbstractElementProxy() {}
-        
-        virtual ListOf(XMLObject) getXMLObjects() {
-            return ListOf(XMLObject)(this,m_children,NULL,m_children.end());
-        }
-    
-        virtual const std::list<XMLObject*>& getXMLObjects() const {
-            return m_children;
-        }
-
-    protected:
-        AbstractElementProxy() {}
-        
-        /** Copy constructor. */
-        AbstractElementProxy(const AbstractElementProxy& src) : AbstractXMLObject(src), AbstractComplexElement(src) {}
-    };
-    
-};
-
-#if defined (_MSC_VER)
-    #pragma warning( pop )
-#endif
-
-#endif /* __xmltooling_abseleproxy_h__ */
index 05377f1..2bd10d8 100644 (file)
  */
 
 /**
- * @file AttributeExtensibleXMLObject.h
+ * @file xmltooling/AttributeExtensibleXMLObject.h
  * 
  * An XMLObject that supports arbitrary attributes 
  */
 
-#if !defined(__xmltooling_attrextxmlobj_h__)
+#ifndef __xmltooling_attrextxmlobj_h__
 #define __xmltooling_attrextxmlobj_h__
 
 #include <xmltooling/XMLObject.h>
 
-using namespace xercesc;
-
 #if defined (_MSC_VER)
     #pragma warning( push )
     #pragma warning( disable : 4250 4251 )
diff --git a/xmltooling/ElementExtensibleXMLObject.h b/xmltooling/ElementExtensibleXMLObject.h
new file mode 100644 (file)
index 0000000..4e98c97
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file xmltooling/ElementExtensibleXMLObject.h
+ * 
+ * An XMLObject that exposes arbitrary children via a mutable vector. 
+ */
+
+#ifndef __xmltooling_eleextxmlobj_h__
+#define __xmltooling_eleextxmlobj_h__
+
+#include <xmltooling/XMLObject.h>
+#include <xmltooling/util/XMLObjectChildrenList.h>
+
+#if defined (_MSC_VER)
+    #pragma warning( push )
+    #pragma warning( disable : 4250 4251 )
+#endif
+
+namespace xmltooling {
+
+    /**
+     * An XMLObject that exposes arbitrary children via a mutable vector.
+     */
+    class XMLTOOL_API ElementExtensibleXMLObject : public virtual XMLObject
+    {
+    protected:
+        ElementExtensibleXMLObject() {}
+    
+    public:
+        virtual ~ElementExtensibleXMLObject() {}
+        
+        /**
+         * Gets a mutable list of child objects
+         * 
+         * @return  mutable list of child objects
+         */
+        virtual VectorOf(XMLObject) getUnknownXMLObjects()=0;
+
+        /**
+         * Gets an immutable list of child objects
+         * 
+         * @return  immutable list of child objects
+         */
+        virtual const std::vector<XMLObject*>& getUnknownXMLObjects() const=0;
+    };
+    
+};
+
+#if defined (_MSC_VER)
+    #pragma warning( pop )
+#endif
+
+#endif /* __xmltooling_eleextxmlobj_h__ */
index 6b5c44e..866185e 100644 (file)
@@ -23,7 +23,8 @@
 #ifndef __xmltooling_eleproxy_h__
 #define __xmltooling_eleproxy_h__
 
-#include <xmltooling/XMLObject.h>
+#include <xmltooling/AttributeExtensibleXMLObject.h>
+#include <xmltooling/ElementExtensibleXMLObject.h>
 #include <xmltooling/util/XMLObjectChildrenList.h>
 
 using namespace xercesc;
@@ -31,27 +32,15 @@ using namespace xercesc;
 namespace xmltooling {
 
     /**
-     * An XMLObject that exposes its children via mutable list.
+     * An XMLObject with an open content model.
      */
-    class XMLTOOL_API ElementProxy : public virtual XMLObject
+    class XMLTOOL_API ElementProxy : public virtual AttributeExtensibleXMLObject, public virtual ElementExtensibleXMLObject
     {
-    public:
+    protected:
         ElementProxy() {}
+
+    public:
         virtual ~ElementProxy() {}
-        
-        /**
-         * Gets a mutable list of child objects
-         * 
-         * @return  mutable list of child objects
-         */
-        virtual ListOf(XMLObject) getXMLObjects()=0;
-
-        /**
-         * Gets an immutable list of child objects
-         * 
-         * @return  immutable list of child objects
-         */
-        virtual const std::list<XMLObject*>& getXMLObjects() const=0;
     };
     
 };
index d30c2a2..ee9038c 100644 (file)
@@ -24,12 +24,12 @@ libxmltoolinginclude_HEADERS = \
        AbstractAttributeExtensibleXMLObject.h \
        AbstractComplexElement.h \
        AbstractDOMCachingXMLObject.h \
-       AbstractElementProxy.h \
        AbstractSimpleElement.h \
        AbstractXMLObject.h \
        AttributeExtensibleXMLObject.h \
        base.h \
        config_pub.h \
+       ElementExtensibleXMLObject.h \
        ElementProxy.h \
        exceptions.h \
        Lockable.h \
index dd698d6..ab1b57c 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef __xmltooling_encryption_h__
 #define __xmltooling_encryption_h__
 
-#include <xmltooling/AttributeExtensibleXMLObject.h>
 #include <xmltooling/signature/KeyInfo.h>
 
 #define DECL_XMLENCOBJECTBUILDER(cname) \
@@ -43,11 +42,10 @@ namespace xmlencryption {
         DECL_INTEGER_CONTENT(Size);
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,EncryptionMethod,xmltooling::XMLObject,XML Encryption EncryptionMethod element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,EncryptionMethod,xmltooling::ElementExtensibleXMLObject,XML Encryption EncryptionMethod element);
         DECL_STRING_ATTRIB(Algorithm,ALGORITHM);
         DECL_TYPED_CHILD(KeySize);
         DECL_TYPED_CHILD(OAEPparams);
-        DECL_XMLOBJECT_CHILDREN(OtherParameter);
         /** EncryptionMethodType local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
@@ -72,7 +70,7 @@ namespace xmlencryption {
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT2(XMLTOOL_API,EncryptionProperty,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,XML Encryption EncryptionProperty element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,EncryptionProperty,xmltooling::ElementProxy,XML Encryption EncryptionProperty element);
         DECL_STRING_ATTRIB(Target,TARGET);
         DECL_STRING_ATTRIB(Id,ID);
         /** EncryptionPropertyType local name */
@@ -86,7 +84,7 @@ namespace xmlencryption {
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,ReferenceType,xmltooling::ElementProxy,XML Encryption ReferenceType type);
+    BEGIN_XMLOBJECT(XMLTOOL_API,ReferenceType,xmltooling::ElementExtensibleXMLObject,XML Encryption ReferenceType type);
         DECL_STRING_ATTRIB(URI,URI);
         /** ReferenceType local name */
         static const XMLCh TYPE_NAME[];
index a0fbc7c..7a8d553 100644 (file)
@@ -74,7 +74,7 @@ DOMDocumentFragment* Decrypter::decryptData(EncryptedData* encryptedData)
                 throw DecryptionException("No EncryptionMethod/@Algorithm set, key decryption cannot proceed.");
             
             if (encryptedData->getKeyInfo()) {
-                const vector<XMLObject*>& others=const_cast<const KeyInfo*>(encryptedData->getKeyInfo())->getOthers();
+                const vector<XMLObject*>& others=const_cast<const KeyInfo*>(encryptedData->getKeyInfo())->getUnknownXMLObjects();
                 for (vector<XMLObject*>::const_iterator i=others.begin(); i!=others.end(); i++) {
                     EncryptedKey* encKey=dynamic_cast<EncryptedKey*>(*i);
                     if (encKey) {
index 43185e8..f6aafd2 100644 (file)
@@ -211,7 +211,7 @@ EncryptedData* Encrypter::decorateAndUnmarshall(EncryptionParams& encParams, Key
         // Add the EncryptedKey.
         if (!xmlEncData->getKeyInfo())
             xmlEncData->setKeyInfo(KeyInfoBuilder::buildKeyInfo());
-        xmlEncData->getKeyInfo()->getOthers().push_back(xmlEncKey);
+        xmlEncData->getKeyInfo()->getUnknownXMLObjects().push_back(xmlEncKey);
         xmlObjectKey.release();
     }
     
index ae25710..c3809d5 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "internal.h"
 #include "AbstractAttributeExtensibleXMLObject.h"
+#include "AbstractComplexElement.h"
 #include "AbstractSimpleElement.h"
-#include "AbstractElementProxy.h"
 #include "exceptions.h"
 #include "encryption/Encryption.h"
 #include "io/AbstractXMLObjectMarshaller.h"
@@ -84,19 +84,16 @@ namespace xmlencryption {
                 setKeySize(src.getKeySize()->cloneKeySize());
             if (src.getOAEPparams())
                 setOAEPparams(src.getOAEPparams()->cloneOAEPparams());
-            VectorOf(XMLObject) v=getOtherParameters();
-            for (vector<XMLObject*>::const_iterator i=src.m_OtherParameters.begin(); i!=src.m_OtherParameters.end(); i++) {
-                if (*i) {
-                    v.push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(EncryptionMethod);
         IMPL_STRING_ATTRIB(Algorithm);
         IMPL_TYPED_CHILD(KeySize);
         IMPL_TYPED_CHILD(OAEPparams);
-        IMPL_XMLOBJECT_CHILDREN(OtherParameter,m_children.end());
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void marshallAttributes(DOMElement* domElement) const {
@@ -110,7 +107,7 @@ namespace xmlencryption {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLENC_NS) && nsURI && *nsURI) {
-                getOtherParameters().push_back(childXMLObject);
+                getUnknownXMLObjects().push_back(childXMLObject);
                 return;
             }
             
@@ -251,8 +248,8 @@ namespace xmlencryption {
     };
 
     class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
-        public AbstractElementProxy,
         public AbstractAttributeExtensibleXMLObject,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -273,22 +270,21 @@ namespace xmlencryption {
             
         EncryptionPropertyImpl(const EncryptionPropertyImpl& src)
                 : AbstractXMLObject(src),
-                    AbstractElementProxy(src),
                     AbstractAttributeExtensibleXMLObject(src),
+                    AbstractComplexElement(src),
                     AbstractDOMCachingXMLObject(src) {
             init();
             setId(src.getId());
             setTarget(src.getTarget());
-            for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                if (*i) {
-                    getXMLObjects().push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(EncryptionProperty);
         IMPL_ID_ATTRIB(Id);
         IMPL_STRING_ATTRIB(Target);
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
 
         void setAttribute(QName& qualifiedName, const XMLCh* value) {
             if (!qualifiedName.hasNamespaceURI()) {
@@ -312,7 +308,7 @@ namespace xmlencryption {
         }
 
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-            getXMLObjects().push_back(childXMLObject);
+            getUnknownXMLObjects().push_back(childXMLObject);
         }
 
         void processAttribute(const DOMAttr* attribute) {
@@ -373,7 +369,7 @@ namespace xmlencryption {
     };
 
     class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
-        public AbstractElementProxy,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -398,18 +394,17 @@ namespace xmlencryption {
         }
             
         ReferenceTypeImpl(const ReferenceTypeImpl& src)
-                : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
+                : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
             init();
             setURI(src.getURI());
-            for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                if (*i) {
-                    getXMLObjects().push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(ReferenceType);
         IMPL_STRING_ATTRIB(URI);
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void marshallAttributes(DOMElement* domElement) const {
@@ -417,7 +412,7 @@ namespace xmlencryption {
         }
 
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-            getXMLObjects().push_back(childXMLObject);
+            getUnknownXMLObjects().push_back(childXMLObject);
         }
 
         void processAttribute(const DOMAttr* attribute) {
index 5bf1218..72ac584 100644 (file)
@@ -69,7 +69,7 @@ namespace xmlencryption {
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,EncryptionProperty);
         if (!ptr->hasChildren())
             throw ValidationException("EncryptionProperty must have at least one child element.");
-        const list<XMLObject*>& anys=ptr->getXMLObjects();
+        const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
         for_each(anys.begin(),anys.end(),checkWildcardNS());
     END_XMLOBJECTVALIDATOR;
 
@@ -79,7 +79,7 @@ namespace xmlencryption {
 
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,ReferenceType);
         XMLOBJECTVALIDATOR_REQUIRE(DataReference,URI);
-        const list<XMLObject*>& anys=ptr->getXMLObjects();
+        const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
         for_each(anys.begin(),anys.end(),checkWildcardNS());
     END_XMLOBJECTVALIDATOR;
 
index bdb3ccc..5e813a5 100644 (file)
@@ -45,10 +45,10 @@ XMLObject* AnyElementImpl::clone() const {
 }
 
 AnyElementImpl::AnyElementImpl(const AnyElementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src),
-    AbstractElementProxy(src), AbstractAttributeExtensibleXMLObject(src) {
-    for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-        getXMLObjects().push_back((*i) ? (*i)->clone() : NULL);
-    }
+        AbstractComplexElement(src), AbstractAttributeExtensibleXMLObject(src) {
+    const vector<XMLObject*>& children = src.getUnknownXMLObjects();
+    for (vector<XMLObject*>::const_iterator i=children.begin(); i!=children.end(); ++i)
+        getUnknownXMLObjects().push_back((*i)->clone());
 }       
 
 void AnyElementImpl::marshallAttributes(DOMElement* domElement) const {
@@ -56,7 +56,7 @@ void AnyElementImpl::marshallAttributes(DOMElement* domElement) const {
 }
 
 void AnyElementImpl::processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-    getXMLObjects().push_back(childXMLObject);
+    getUnknownXMLObjects().push_back(childXMLObject);
 }
 
 void AnyElementImpl::processAttribute(const DOMAttr* attribute) {
index 4e668c8..789c6ea 100644 (file)
  * Advanced anyType implementation suitable for deep processing of unknown content.
  */
 
-#if !defined(__xmltooling_anyelement_h__)
+#ifndef __xmltooling_anyelement_h__
 #define __xmltooling_anyelement_h__
 
+#include <xmltooling/ElementProxy.h>
 #include <xmltooling/AbstractAttributeExtensibleXMLObject.h>
-#include <xmltooling/AbstractElementProxy.h>
+#include <xmltooling/AbstractComplexElement.h>
 #include <xmltooling/XMLObjectBuilder.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
@@ -39,8 +40,9 @@ namespace xmltooling {
     /**
      * Implements a smart wrapper around unknown or arbitrary DOM content.
      */
-    class XMLTOOL_API AnyElementImpl : public AbstractDOMCachingXMLObject,
-        public AbstractElementProxy,
+    class XMLTOOL_API AnyElementImpl : public virtual ElementProxy,
+        public AbstractDOMCachingXMLObject,
+        public AbstractComplexElement,
         public AbstractAttributeExtensibleXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -55,7 +57,9 @@ namespace xmltooling {
         
     protected:
         AnyElementImpl() {}
-        AnyElementImpl(const AnyElementImpl& src);   
+        AnyElementImpl(const AnyElementImpl& src);
+        
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
         
         void marshallAttributes(DOMElement* domElement) const;
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root);
index 410403e..720455b 100644 (file)
@@ -77,12 +77,12 @@ namespace xmlsignature {
     BEGIN_XMLOBJECT(XMLTOOL_API,KeyValue,xmltooling::XMLObject,XML Digital Signature version 20020212 KeyValue element);
         DECL_TYPED_CHILD(DSAKeyValue);
         DECL_TYPED_CHILD(RSAKeyValue);
-        DECL_XMLOBJECT_CHILD(OtherKeyValue);
+        DECL_XMLOBJECT_CHILD(UnknownXMLObject);
         /** KeyValueType local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,Transform,xmltooling::ElementProxy,XML Digital Signature version 20020212 Transform element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,Transform,xmltooling::ElementExtensibleXMLObject,XML Digital Signature version 20020212 Transform element);
         DECL_STRING_ATTRIB(Algorithm,ALGORITHM);
         DECL_TYPED_CHILDREN(XPath);
         /** TransformType local name */
@@ -116,13 +116,12 @@ namespace xmlsignature {
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,X509Data,xmltooling::XMLObject,XML Digital Signature version 20020212 X509Data element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,X509Data,xmltooling::ElementExtensibleXMLObject,XML Digital Signature version 20020212 X509Data element);
         DECL_TYPED_CHILDREN(X509IssuerSerial);
         DECL_TYPED_CHILDREN(X509SKI);
         DECL_TYPED_CHILDREN(X509SubjectName);
         DECL_TYPED_CHILDREN(X509Certificate);
         DECL_TYPED_CHILDREN(X509CRL);
-        DECL_XMLOBJECT_CHILDREN(OtherX509Data);
         /** X509DataType local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
@@ -138,15 +137,14 @@ namespace xmlsignature {
         virtual const std::vector< std::pair<SPKISexp*,xmltooling::XMLObject*> >& getSPKISexps() const=0;
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,PGPData,xmltooling::XMLObject,XML Digital Signature version 20020212 PGPData element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,PGPData,xmltooling::ElementExtensibleXMLObject,XML Digital Signature version 20020212 PGPData element);
         DECL_TYPED_CHILD(PGPKeyID);
         DECL_TYPED_CHILD(PGPKeyPacket);
-        DECL_XMLOBJECT_CHILDREN(PGPDataExtension);
         /** PGPDataType local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT(XMLTOOL_API,KeyInfo,xmltooling::XMLObject,XML Digital Signature version 20020212 KeyInfo element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,KeyInfo,xmltooling::ElementExtensibleXMLObject,XML Digital Signature version 20020212 KeyInfo element);
         DECL_STRING_ATTRIB(Id,ID);
         DECL_TYPED_CHILDREN(X509Data);
         DECL_TYPED_CHILDREN(KeyName);
@@ -155,7 +153,6 @@ namespace xmlsignature {
         DECL_TYPED_CHILDREN(MgmtData);
         DECL_TYPED_CHILDREN(PGPData);
         DECL_TYPED_CHILDREN(SPKIData);
-        DECL_XMLOBJECT_CHILDREN(Other);
         /** KeyInfoType local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
index 215392f..f89eb98 100644 (file)
@@ -21,9 +21,7 @@
  */
 
 #include "internal.h"
-#include "AbstractSimpleElement.h"
 #include "AbstractComplexElement.h"
-#include "AbstractElementProxy.h"
 #include "AbstractSimpleElement.h"
 #include "exceptions.h"
 #include "io/AbstractXMLObjectMarshaller.h"
@@ -196,28 +194,28 @@ namespace xmlsignature {
                 setDSAKeyValue(src.getDSAKeyValue()->cloneDSAKeyValue());
             if (src.getRSAKeyValue())
                 setRSAKeyValue(src.getRSAKeyValue()->cloneRSAKeyValue());
-            if (src.getOtherKeyValue())
-                setOtherKeyValue(src.getOtherKeyValue()->clone());
+            if (src.getUnknownXMLObject())
+                setUnknownXMLObject(src.getUnknownXMLObject()->clone());
         }
         
         void init() {
             m_DSAKeyValue=NULL;
             m_RSAKeyValue=NULL;
-            m_OtherKeyValue=NULL;
+            m_UnknownXMLObject=NULL;
             m_children.push_back(NULL);
             m_children.push_back(NULL);
             m_children.push_back(NULL);
             m_pos_DSAKeyValue=m_children.begin();
             m_pos_RSAKeyValue=m_pos_DSAKeyValue;
             ++m_pos_RSAKeyValue;
-            m_pos_OtherKeyValue=m_pos_RSAKeyValue;
-            ++m_pos_OtherKeyValue;
+            m_pos_UnknownXMLObject=m_pos_RSAKeyValue;
+            ++m_pos_UnknownXMLObject;
         }
         
         IMPL_XMLOBJECT_CLONE(KeyValue);
         IMPL_TYPED_CHILD(DSAKeyValue);
         IMPL_TYPED_CHILD(RSAKeyValue);
-        IMPL_XMLOBJECT_CHILD(OtherKeyValue);
+        IMPL_XMLOBJECT_CHILD(UnknownXMLObject);
 
     protected:
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
@@ -227,7 +225,7 @@ namespace xmlsignature {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
-                setOtherKeyValue(childXMLObject);
+                setUnknownXMLObject(childXMLObject);
                 return;
             }
             
@@ -236,8 +234,8 @@ namespace xmlsignature {
     };
 
     class XMLTOOL_DLLLOCAL TransformImpl : public virtual Transform,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
-        public AbstractElementProxy,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
     {
@@ -251,7 +249,7 @@ namespace xmlsignature {
         }
             
         TransformImpl(const TransformImpl& src)
-                : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src),
+                : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src),
                     m_Algorithm(XMLString::replicate(src.m_Algorithm)) {
             for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                 if (*i) {
@@ -260,7 +258,7 @@ namespace xmlsignature {
                         getXPaths().push_back(x->cloneXPath());
                         continue;
                     }
-                    getXMLObjects().push_back((*i)->clone());
+                    getUnknownXMLObjects().push_back((*i)->clone());
                 }
             }
         }
@@ -268,6 +266,7 @@ namespace xmlsignature {
         IMPL_XMLOBJECT_CLONE(Transform);
         IMPL_STRING_ATTRIB(Algorithm);
         IMPL_TYPED_CHILDREN(XPath,m_children.end());
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void marshallAttributes(DOMElement* domElement) const {
@@ -280,7 +279,7 @@ namespace xmlsignature {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
-                getXMLObjects().push_back(childXMLObject);
+                getUnknownXMLObjects().push_back(childXMLObject);
                 return;
             }
             
@@ -474,7 +473,7 @@ namespace xmlsignature {
                         continue;
                     }
 
-                    getOtherX509Datas().push_back((*i)->clone());
+                    getUnknownXMLObjects().push_back((*i)->clone());
                 }
             }
         }
@@ -485,7 +484,7 @@ namespace xmlsignature {
         IMPL_TYPED_CHILDREN(X509SubjectName,m_children.end());
         IMPL_TYPED_CHILDREN(X509Certificate,m_children.end());
         IMPL_TYPED_CHILDREN(X509CRL,m_children.end());
-        IMPL_XMLOBJECT_CHILDREN(OtherX509Data,m_children.end());
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
@@ -498,7 +497,7 @@ namespace xmlsignature {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
-                getOtherX509Datas().push_back(childXMLObject);
+                getUnknownXMLObjects().push_back(childXMLObject);
                 return;
             }
             
@@ -591,12 +590,9 @@ namespace xmlsignature {
                 setPGPKeyID(src.getPGPKeyID()->clonePGPKeyID());
             if (src.getPGPKeyPacket())
                 setPGPKeyPacket(src.getPGPKeyPacket()->clonePGPKeyPacket());
-            VectorOf(XMLObject) v=getPGPDataExtensions();
-            for (vector<XMLObject*>::const_iterator i=src.m_PGPDataExtensions.begin(); i!=src.m_PGPDataExtensions.end(); i++) {
-                if (*i) {
-                    v.push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         void init() {
@@ -612,7 +608,7 @@ namespace xmlsignature {
         IMPL_XMLOBJECT_CLONE(PGPData);
         IMPL_TYPED_CHILD(PGPKeyID);
         IMPL_TYPED_CHILD(PGPKeyPacket);
-        IMPL_XMLOBJECT_CHILDREN(PGPDataExtension,m_children.end());
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
@@ -622,7 +618,7 @@ namespace xmlsignature {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
-                getPGPDataExtensions().push_back(childXMLObject);
+                getUnknownXMLObjects().push_back(childXMLObject);
                 return;
             }
 
@@ -693,7 +689,7 @@ namespace xmlsignature {
                         continue;
                     }
 
-                    getOthers().push_back((*i)->clone());
+                    getUnknownXMLObjects().push_back((*i)->clone());
                 }
             }
         }
@@ -707,7 +703,7 @@ namespace xmlsignature {
         IMPL_TYPED_CHILDREN(MgmtData,m_children.end());
         IMPL_TYPED_CHILDREN(SPKIData,m_children.end());
         IMPL_TYPED_CHILDREN(PGPData,m_children.end());
-        IMPL_XMLOBJECT_CHILDREN(Other,m_children.end());
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
     protected:
         void marshallAttributes(DOMElement* domElement) const {
@@ -726,7 +722,7 @@ namespace xmlsignature {
             // Unknown child.
             const XMLCh* nsURI=root->getNamespaceURI();
             if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
-                getOthers().push_back(childXMLObject);
+                getUnknownXMLObjects().push_back(childXMLObject);
                 return;
             }
             
index e227082..d1bb902 100644 (file)
@@ -66,7 +66,7 @@ namespace xmlsignature {
     END_XMLOBJECTVALIDATOR;
 
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,KeyValue);
-        XMLOBJECTVALIDATOR_ONLYONEOF3(KeyValue,DSAKeyValue,RSAKeyValue,OtherKeyValue);
+        XMLOBJECTVALIDATOR_ONLYONEOF3(KeyValue,DSAKeyValue,RSAKeyValue,UnknownXMLObject);
     END_XMLOBJECTVALIDATOR;
 
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,Transform);
@@ -102,7 +102,7 @@ namespace xmlsignature {
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,X509Data);
         if (!ptr->hasChildren())
             throw ValidationException("X509Data must have at least one child element.");
-        const vector<XMLObject*>& anys=ptr->getOtherX509Datas();
+        const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
         for_each(anys.begin(),anys.end(),checkWildcardNS());
     END_XMLOBJECTVALIDATOR;
 
@@ -117,7 +117,7 @@ namespace xmlsignature {
     BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,KeyInfo);
         if (!ptr->hasChildren())
             throw ValidationException("KeyInfo must have at least one child element.");
-        const vector<XMLObject*>& anys=ptr->getOthers();
+        const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
         for_each(anys.begin(),anys.end(),checkWildcardNS());
     END_XMLOBJECTVALIDATOR;
 
index 4ea21e2..e7aeb22 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef __xmltooling_soap_h__
 #define __xmltooling_soap_h__
 
-#include <xmltooling/AttributeExtensibleXMLObject.h>
 #include <xmltooling/ElementProxy.h>
 #include <xmltooling/XMLObjectBuilder.h>
 #include <xmltooling/util/XMLConstants.h>
@@ -48,7 +47,7 @@ namespace soap11 {
         virtual void setCode(const xmltooling::QName* qname)=0;
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT2(XMLTOOL_API,Detail,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SOAP 1.1 detail element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,Detail,xmltooling::ElementProxy,SOAP 1.1 detail element);
         /** detail (type) local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
@@ -62,13 +61,13 @@ namespace soap11 {
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT2(XMLTOOL_API,Body,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SOAP 1.1 Body element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,Body,xmltooling::ElementProxy,SOAP 1.1 Body element);
         DECL_STRING_ATTRIB(EncodingStyle,ENCODINGSTYLE);
         /** Body (type) local name */
         static const XMLCh TYPE_NAME[];
     END_XMLOBJECT;
 
-    BEGIN_XMLOBJECT2(XMLTOOL_API,Header,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SOAP 1.1 Header element);
+    BEGIN_XMLOBJECT(XMLTOOL_API,Header,xmltooling::ElementProxy,SOAP 1.1 Header element);
         DECL_BOOLEAN_ATTRIB(MustUnderstand,MUSTUNDERSTAND,false);
         DECL_STRING_ATTRIB(Actor,ACTOR);
         /** Header (type) local name */
index 2b33055..d785b63 100644 (file)
@@ -90,7 +90,7 @@ Envelope* SOAPClient::receive()
     Body* body = env->getBody();
     if (body && body->hasChildren()) {
         //Check for a Fault.
-        const Fault* fault = dynamic_cast<Fault*>(body->getXMLObjects().front());
+        const Fault* fault = dynamic_cast<Fault*>(body->getUnknownXMLObjects().front());
         if (fault && handleFault(*fault))
             throw IOException("SOAP client detected a Fault.");
     }
index be75300..305255d 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "internal.h"
 #include "AbstractAttributeExtensibleXMLObject.h"
+#include "AbstractComplexElement.h"
 #include "AbstractSimpleElement.h"
-#include "AbstractElementProxy.h"
 #include "exceptions.h"
 #include "io/AbstractXMLObjectMarshaller.h"
 #include "io/AbstractXMLObjectUnmarshaller.h"
@@ -86,8 +86,8 @@ namespace {
     };
 
     class XMLTOOL_DLLLOCAL DetailImpl : public virtual Detail,
-        public AbstractElementProxy,
         public AbstractAttributeExtensibleXMLObject,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -101,17 +101,16 @@ namespace {
             
         DetailImpl(const DetailImpl& src)
                 : AbstractXMLObject(src),
-                    AbstractElementProxy(src),
                     AbstractAttributeExtensibleXMLObject(src),
+                    AbstractComplexElement(src),
                     AbstractDOMCachingXMLObject(src) {
-            for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                if (*i) {
-                    getXMLObjects().push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(Detail);
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
 
     protected:
         void marshallAttributes(DOMElement* domElement) const {
@@ -119,7 +118,7 @@ namespace {
         }
 
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-            getXMLObjects().push_back(childXMLObject);
+            getUnknownXMLObjects().push_back(childXMLObject);
         }
 
         void processAttribute(const DOMAttr* attribute) {
@@ -193,8 +192,8 @@ namespace {
     };
 
     class XMLTOOL_DLLLOCAL BodyImpl : public virtual Body,
-        public AbstractElementProxy,
         public AbstractAttributeExtensibleXMLObject,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -214,20 +213,19 @@ namespace {
             
         BodyImpl(const BodyImpl& src)
                 : AbstractXMLObject(src),
-                    AbstractElementProxy(src),
                     AbstractAttributeExtensibleXMLObject(src),
+                    AbstractComplexElement(src),
                     AbstractDOMCachingXMLObject(src) {
             init();
             setEncodingStyle(src.getEncodingStyle());
-            for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                if (*i) {
-                    getXMLObjects().push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(Body);
         IMPL_STRING_ATTRIB(EncodingStyle);
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
 
         void setAttribute(QName& qualifiedName, const XMLCh* value) {
             if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),SOAP11ENV_NS)) {
@@ -246,7 +244,7 @@ namespace {
         }
 
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-            getXMLObjects().push_back(childXMLObject);
+            getUnknownXMLObjects().push_back(childXMLObject);
         }
 
         void processAttribute(const DOMAttr* attribute) {
@@ -255,8 +253,8 @@ namespace {
     };
 
     class XMLTOOL_DLLLOCAL HeaderImpl : public virtual Header,
-        public AbstractElementProxy,
         public AbstractAttributeExtensibleXMLObject,
+        public AbstractComplexElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -277,22 +275,21 @@ namespace {
             
         HeaderImpl(const HeaderImpl& src)
                 : AbstractXMLObject(src),
-                    AbstractElementProxy(src),
                     AbstractAttributeExtensibleXMLObject(src),
+                    AbstractComplexElement(src),
                     AbstractDOMCachingXMLObject(src) {
             init();
             setActor(src.getActor());
             MustUnderstand(m_MustUnderstand);
-            for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                if (*i) {
-                    getXMLObjects().push_back((*i)->clone());
-                }
-            }
+            VectorOf(XMLObject) v=getUnknownXMLObjects();
+            for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                v.push_back((*i)->clone());
         }
         
         IMPL_XMLOBJECT_CLONE(Header);
         IMPL_STRING_ATTRIB(Actor);
         IMPL_BOOLEAN_ATTRIB(MustUnderstand);
+        IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
 
         void setAttribute(QName& qualifiedName, const XMLCh* value) {
             if (qualifiedName.hasNamespaceURI() && XMLString::equals(qualifiedName.getNamespaceURI(),SOAP11ENV_NS)) {
@@ -316,7 +313,7 @@ namespace {
         }
 
         void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-            getXMLObjects().push_back(childXMLObject);
+            getUnknownXMLObjects().push_back(childXMLObject);
         }
 
         void processAttribute(const DOMAttr* attribute) {
index 0633ada..1f8ef10 100644 (file)
@@ -46,20 +46,18 @@ public:
             );
         TS_ASSERT(wcObject.get()!=NULL);
         
-        ListOf(XMLObject) kids=wcObject->getXMLObjects();
+        VectorOf(XMLObject) kids=wcObject->getUnknownXMLObjects();
         TSM_ASSERT_EQUALS("Number of child elements was not expected value", 2, kids.size());
         
         ElementProxy* wc1=dynamic_cast<ElementProxy*>(*(++kids.begin()));
-        ElementProxy* wc2=dynamic_cast<ElementProxy*>(*(++(wc1->getXMLObjects().begin())));
-        TSM_ASSERT_EQUALS("Number of child elements was not expected value", 3, wc2->getXMLObjects().size());
+        ElementProxy* wc2=dynamic_cast<ElementProxy*>(*(++(wc1->getUnknownXMLObjects().begin())));
+        TSM_ASSERT_EQUALS("Number of child elements was not expected value", 3, wc2->getUnknownXMLObjects().size());
 
         static const XMLCh html[] = {chLatin_h, chLatin_t, chLatin_m, chLatin_l, chNull};
         static const XMLCh div[] = {chLatin_d, chLatin_i, chLatin_v, chNull};
         auto_ptr_XMLCh htmlns("http://www.w3.org/1999/xhtml");
         QName q(htmlns.get(),div,html);
-        ListOf(XMLObject)::const_iterator it=wc2->getXMLObjects().begin();
-        ++it; ++it;
-        TSM_ASSERT_EQUALS("Element QName unexpected", it->getElementQName(),q);
+        TSM_ASSERT_EQUALS("Element QName unexpected", wc2->getUnknownXMLObjects()[2]->getElementQName(),q);
 
         DOMElement* rebuilt = wcObject->marshall(XMLToolingConfig::getConfig().getParser().newDocument());
         wcObject->setDocument(rebuilt->getOwnerDocument());