-/*\r
-* Copyright 2001-2006 Internet2\r
- * \r
-* Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file UnknownElement.h\r
- * \r
- * Basic implementation suitable for use as default for unrecognized content\r
- */\r
-\r
-#if !defined(__xmltooling_unkelement_h__)\r
-#define __xmltooling_unkelement_h__\r
-\r
-#include <xmltooling/exceptions.h>\r
-#include <xmltooling/XMLObjectBuilder.h>\r
-#include <xmltooling/io/AbstractXMLObjectMarshaller.h>\r
-#include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>\r
-\r
-#include <string>\r
-\r
-#if defined (_MSC_VER)\r
- #pragma warning( push )\r
- #pragma warning( disable : 4250 4251 )\r
-#endif\r
-\r
-namespace xmltooling {\r
-\r
- /// @cond off\r
- class XMLTOOL_DLLLOCAL UnknownElementImpl : public AbstractDOMCachingXMLObject\r
- {\r
- public:\r
- UnknownElementImpl(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL)\r
- : AbstractXMLObject(namespaceURI, elementLocalName, namespacePrefix) {}\r
- \r
- void releaseDOM();\r
-\r
- XMLObject* clone() const;\r
-\r
- DOMElement* marshall(DOMDocument* document=NULL, MarshallingContext* ctx=NULL) const;\r
- DOMElement* marshall(DOMElement* parentElement, MarshallingContext* ctx=NULL) const;\r
- XMLObject* unmarshall(DOMElement* element, bool bindDocument=false);\r
- \r
- protected:\r
- void setDocumentElement(DOMDocument* document, DOMElement* element) const {\r
- DOMElement* documentRoot = document->getDocumentElement();\r
- if (documentRoot)\r
- document->replaceChild(documentRoot, element);\r
- else\r
- document->appendChild(element);\r
- }\r
-\r
- mutable std::string m_xml;\r
-\r
- void serialize(std::string& s) const;\r
- };\r
- /// @endcond\r
- \r
- /**\r
- * Builder for UnknownElementImpl objects.\r
- * Use as the default builder when you want unknown DOM content treated as raw/ignored XML.\r
- */\r
- class XMLTOOL_API UnknownElementBuilder : public XMLObjectBuilder\r
- {\r
- public:\r
- XMLObject* buildObject(\r
- const XMLCh* namespaceURI, const XMLCh* elementLocalName, const XMLCh* namespacePrefix=NULL\r
- ) const {\r
- return new UnknownElementImpl(namespaceURI,elementLocalName,namespacePrefix);\r
- }\r
- };\r
-\r
-};\r
-\r
-#if defined (_MSC_VER)\r
- #pragma warning( pop )\r
-#endif\r
-\r
-#endif /* __xmltooling_unkelement_h__ */\r
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ *
+ * UCAID licenses this file to you 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/impl/UnknownElement.h
+ *
+ * Basic implementation suitable for use as default for unrecognized content.
+ */
+
+#ifndef __xmltooling_unkelement_h__
+#define __xmltooling_unkelement_h__
+
+#include <xmltooling/AbstractSimpleElement.h>
+#include <xmltooling/exceptions.h>
+#include <xmltooling/XMLObjectBuilder.h>
+#include <xmltooling/io/AbstractXMLObjectMarshaller.h>
+#include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
+
+#include <string>
+
+#if defined (_MSC_VER)
+ #pragma warning( push )
+ #pragma warning( disable : 4250 4251 )
+#endif
+
+namespace xmltooling {
+
+ /// @cond off
+ class XMLTOOL_DLLLOCAL UnknownElementImpl : public AbstractSimpleElement, public AbstractDOMCachingXMLObject
+ {
+ public:
+ UnknownElementImpl(const XMLCh* namespaceURI=nullptr, const XMLCh* elementLocalName=nullptr, const XMLCh* namespacePrefix=nullptr);
+
+ virtual ~UnknownElementImpl();
+
+ void releaseDOM() const;
+ XMLObject* clone() const;
+ const XMLCh* getTextContent(unsigned int position=0) const;
+ void setTextContent(const XMLCh*, unsigned int position=0);
+
+ xercesc::DOMElement* marshall(
+ xercesc::DOMDocument* document=nullptr
+#ifndef XMLTOOLING_NO_XMLSEC
+ ,const std::vector<xmlsignature::Signature*>* sigs=nullptr
+ ,const Credential* credential=nullptr
+#endif
+ ) const;
+
+ xercesc::DOMElement* marshall(
+ xercesc::DOMElement* parentElement
+#ifndef XMLTOOLING_NO_XMLSEC
+ ,const std::vector<xmlsignature::Signature*>* sigs=nullptr
+ ,const Credential* credential=nullptr
+#endif
+ ) const;
+ XMLObject* unmarshall(xercesc::DOMElement* element, bool bindDocument=false);
+
+ protected:
+ void setDocumentElement(xercesc::DOMDocument* document, xercesc::DOMElement* element) const;
+
+ mutable std::string m_xml;
+
+ void serialize(std::string& s) const;
+ };
+ /// @endcond
+
+ /**
+ * Builder for UnknownElementImpl objects.
+ * Use as the default builder when you want unknown DOM content treated as raw/ignored XML.
+ */
+ class XMLTOOL_API UnknownElementBuilder : public XMLObjectBuilder
+ {
+ public:
+ XMLObject* buildObject(
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr
+ ) const;
+ };
+
+};
+
+#if defined (_MSC_VER)
+ #pragma warning( pop )
+#endif
+
+#endif /* __xmltooling_unkelement_h__ */