2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file xmltooling/impl/AnyElement.h
24 * Advanced anyType implementation suitable for deep processing of unknown content.
27 #ifndef __xmltooling_anyelement_h__
28 #define __xmltooling_anyelement_h__
30 #include <xmltooling/ElementProxy.h>
31 #include <xmltooling/AbstractAttributeExtensibleXMLObject.h>
32 #include <xmltooling/AbstractComplexElement.h>
33 #include <xmltooling/XMLObjectBuilder.h>
34 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
35 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
37 #if defined (_MSC_VER)
38 #pragma warning( push )
39 #pragma warning( disable : 4250 4251 )
42 namespace xmltooling {
45 * Implements a smart wrapper around unknown or arbitrary DOM content.
47 class XMLTOOL_API AnyElementImpl : public virtual ElementProxy,
48 public AbstractDOMCachingXMLObject,
49 public AbstractComplexElement,
50 public AbstractAttributeExtensibleXMLObject,
51 public AbstractXMLObjectMarshaller,
52 public AbstractXMLObjectUnmarshaller
56 virtual ~AnyElementImpl();
58 AnyElementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr);
60 XMLObject* clone() const;
64 AnyElementImpl(const AnyElementImpl& src);
66 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
68 void marshallAttributes(xercesc::DOMElement* domElement) const;
69 void processChildElement(XMLObject* childXMLObject, const xercesc::DOMElement* childRoot);
70 void processAttribute(const xercesc::DOMAttr* attribute);
75 * Builder for AnyElementImpl objects.
76 * Use as the default builder when you want to wrap each unknown element and
77 * process the DOM content through xmltooling interfaces.
79 class XMLTOOL_API AnyElementBuilder : public XMLObjectBuilder
82 XMLObject* buildObject(
83 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr
89 #if defined (_MSC_VER)
90 #pragma warning( pop )
93 #endif /* __xmltooling_anyelement_h__ */