+++ /dev/null
-/*
- * 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__ */
*/
/**
- * @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 )
--- /dev/null
+/*
+ * 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__ */
#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;
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;
};
};
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 \
#ifndef __xmltooling_encryption_h__
#define __xmltooling_encryption_h__
-#include <xmltooling/AttributeExtensibleXMLObject.h>
#include <xmltooling/signature/KeyInfo.h>
#define DECL_XMLENCOBJECTBUILDER(cname) \
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;
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 */
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[];
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) {
// Add the EncryptedKey.
if (!xmlEncData->getKeyInfo())
xmlEncData->setKeyInfo(KeyInfoBuilder::buildKeyInfo());
- xmlEncData->getKeyInfo()->getOthers().push_back(xmlEncKey);
+ xmlEncData->getKeyInfo()->getUnknownXMLObjects().push_back(xmlEncKey);
xmlObjectKey.release();
}
#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"
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 {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLENC_NS) && nsURI && *nsURI) {
- getOtherParameters().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
return;
}
};
class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
- public AbstractElementProxy,
public AbstractAttributeExtensibleXMLObject,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
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()) {
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void processAttribute(const DOMAttr* attribute) {
};
class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
- public AbstractElementProxy,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
}
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 {
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void processAttribute(const DOMAttr* attribute) {
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;
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;
}
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 {
}
void AnyElementImpl::processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void AnyElementImpl::processAttribute(const DOMAttr* attribute) {
* 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>
/**
* 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
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);
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 */
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;
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);
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;
*/
#include "internal.h"
-#include "AbstractSimpleElement.h"
#include "AbstractComplexElement.h"
-#include "AbstractElementProxy.h"
#include "AbstractSimpleElement.h"
#include "exceptions.h"
#include "io/AbstractXMLObjectMarshaller.h"
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) {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
- setOtherKeyValue(childXMLObject);
+ setUnknownXMLObject(childXMLObject);
return;
}
};
class XMLTOOL_DLLLOCAL TransformImpl : public virtual Transform,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
- public AbstractElementProxy,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
{
}
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) {
getXPaths().push_back(x->cloneXPath());
continue;
}
- getXMLObjects().push_back((*i)->clone());
+ getUnknownXMLObjects().push_back((*i)->clone());
}
}
}
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 {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
return;
}
continue;
}
- getOtherX509Datas().push_back((*i)->clone());
+ getUnknownXMLObjects().push_back((*i)->clone());
}
}
}
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) {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
- getOtherX509Datas().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
return;
}
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() {
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) {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
- getPGPDataExtensions().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
return;
}
continue;
}
- getOthers().push_back((*i)->clone());
+ getUnknownXMLObjects().push_back((*i)->clone());
}
}
}
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 {
// Unknown child.
const XMLCh* nsURI=root->getNamespaceURI();
if (!XMLString::equals(nsURI,XMLSIG_NS) && nsURI && *nsURI) {
- getOthers().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
return;
}
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);
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;
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;
#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>
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;
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 */
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.");
}
#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"
};
class XMLTOOL_DLLLOCAL DetailImpl : public virtual Detail,
- public AbstractElementProxy,
public AbstractAttributeExtensibleXMLObject,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
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 {
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void processAttribute(const DOMAttr* attribute) {
};
class XMLTOOL_DLLLOCAL BodyImpl : public virtual Body,
- public AbstractElementProxy,
public AbstractAttributeExtensibleXMLObject,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
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)) {
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void processAttribute(const DOMAttr* attribute) {
};
class XMLTOOL_DLLLOCAL HeaderImpl : public virtual Header,
- public AbstractElementProxy,
public AbstractAttributeExtensibleXMLObject,
+ public AbstractComplexElement,
public AbstractDOMCachingXMLObject,
public AbstractXMLObjectMarshaller,
public AbstractXMLObjectUnmarshaller
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)) {
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getXMLObjects().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
void processAttribute(const DOMAttr* attribute) {
);
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());