2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file xmltooling/impl/AnyElement.h
20 * Advanced anyType implementation suitable for deep processing of unknown content.
23 #ifndef __xmltooling_anyelement_h__
24 #define __xmltooling_anyelement_h__
26 #include <xmltooling/ElementProxy.h>
27 #include <xmltooling/AbstractAttributeExtensibleXMLObject.h>
28 #include <xmltooling/AbstractComplexElement.h>
29 #include <xmltooling/XMLObjectBuilder.h>
30 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
31 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
33 #if defined (_MSC_VER)
34 #pragma warning( push )
35 #pragma warning( disable : 4250 4251 )
38 namespace xmltooling {
41 * Implements a smart wrapper around unknown or arbitrary DOM content.
43 class XMLTOOL_API AnyElementImpl : public virtual ElementProxy,
44 public AbstractDOMCachingXMLObject,
45 public AbstractComplexElement,
46 public AbstractAttributeExtensibleXMLObject,
47 public AbstractXMLObjectMarshaller,
48 public AbstractXMLObjectUnmarshaller
52 virtual ~AnyElementImpl() {}
54 AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL)
55 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
57 XMLObject* clone() const;
61 AnyElementImpl(const AnyElementImpl& src);
63 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
65 void marshallAttributes(xercesc::DOMElement* domElement) const;
66 void processChildElement(XMLObject* childXMLObject, const xercesc::DOMElement* childRoot);
67 void processAttribute(const xercesc::DOMAttr* attribute);
72 * Builder for AnyElementImpl objects.
73 * Use as the default builder when you want to wrap each unknown element and
74 * process the DOM content through xmltooling interfaces.
76 class XMLTOOL_API AnyElementBuilder : public XMLObjectBuilder
79 XMLObject* buildObject(
80 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
86 #if defined (_MSC_VER)
87 #pragma warning( pop )
90 #endif /* __xmltooling_anyelement_h__ */