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 #if !defined(__xmltooling_anyelement_h__)
24 #define __xmltooling_anyelement_h__
26 #include <xmltooling/AbstractAttributeExtensibleXMLObject.h>
27 #include <xmltooling/AbstractElementProxy.h>
28 #include <xmltooling/XMLObjectBuilder.h>
29 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
30 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
32 #if defined (_MSC_VER)
33 #pragma warning( push )
34 #pragma warning( disable : 4250 4251 )
37 namespace xmltooling {
40 * Implements a smart wrapper around unknown or arbitrary DOM content.
42 class XMLTOOL_API AnyElementImpl : public AbstractDOMCachingXMLObject,
43 public AbstractElementProxy,
44 public AbstractAttributeExtensibleXMLObject,
45 public AbstractXMLObjectMarshaller,
46 public AbstractXMLObjectUnmarshaller
49 virtual ~AnyElementImpl() {}
51 AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL)
52 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
54 XMLObject* clone() const;
58 AnyElementImpl(const AnyElementImpl& src);
60 void marshallAttributes(DOMElement* domElement) const;
61 void processChildElement(XMLObject* childXMLObject, const DOMElement* root);
62 void processAttribute(const DOMAttr* attribute);
66 * Builder for AnyElementImpl objects.
67 * Use as the default builder when you want to wrap each unknown element and
68 * process the DOM content through xmltooling interfaces.
70 class XMLTOOL_API AnyElementBuilder : public XMLObjectBuilder
73 XMLObject* buildObject(
74 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
80 #if defined (_MSC_VER)
81 #pragma warning( pop )
84 #endif /* __xmltooling_anyelement_h__ */