2 * Copyright 2001-2006 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
51 virtual ~AnyElementImpl() {}
53 AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL)
54 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
56 XMLObject* clone() const;
60 AnyElementImpl(const AnyElementImpl& src);
62 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
64 void marshallAttributes(DOMElement* domElement) const;
65 void processChildElement(XMLObject* childXMLObject, const DOMElement* root);
66 void processAttribute(const DOMAttr* attribute);
70 * Builder for AnyElementImpl objects.
71 * Use as the default builder when you want to wrap each unknown element and
72 * process the DOM content through xmltooling interfaces.
74 class XMLTOOL_API AnyElementBuilder : public XMLObjectBuilder
77 XMLObject* buildObject(
78 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
84 #if defined (_MSC_VER)
85 #pragma warning( pop )
88 #endif /* __xmltooling_anyelement_h__ */