Reordered files in all libs - now all includes are in "libname/include" dir - logical, isn't it? This should break compilation however.
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOM.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOM_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOM_HPP
|
||||
|
||||
//
|
||||
// This is the primary header file for inclusion in application
|
||||
// programs using the C++ XML Document Object Model API.
|
||||
//
|
||||
|
||||
#include <xercesc/dom/DOMAttr.hpp>
|
||||
#include <xercesc/dom/DOMCDATASection.hpp>
|
||||
#include <xercesc/dom/DOMCharacterData.hpp>
|
||||
#include <xercesc/dom/DOMComment.hpp>
|
||||
#include <xercesc/dom/DOMDocument.hpp>
|
||||
#include <xercesc/dom/DOMDocumentFragment.hpp>
|
||||
#include <xercesc/dom/DOMDocumentType.hpp>
|
||||
#include <xercesc/dom/DOMElement.hpp>
|
||||
#include <xercesc/dom/DOMEntity.hpp>
|
||||
#include <xercesc/dom/DOMEntityReference.hpp>
|
||||
#include <xercesc/dom/DOMException.hpp>
|
||||
#include <xercesc/dom/DOMImplementation.hpp>
|
||||
#include <xercesc/dom/DOMNamedNodeMap.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMNodeList.hpp>
|
||||
#include <xercesc/dom/DOMNotation.hpp>
|
||||
#include <xercesc/dom/DOMProcessingInstruction.hpp>
|
||||
#include <xercesc/dom/DOMText.hpp>
|
||||
|
||||
// Introduced in DOM Level 2
|
||||
#include <xercesc/dom/DOMDocumentRange.hpp>
|
||||
#include <xercesc/dom/DOMDocumentTraversal.hpp>
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
#include <xercesc/dom/DOMNodeIterator.hpp>
|
||||
#include <xercesc/dom/DOMRange.hpp>
|
||||
#include <xercesc/dom/DOMRangeException.hpp>
|
||||
#include <xercesc/dom/DOMTreeWalker.hpp>
|
||||
|
||||
// Introduced in DOM Level 3
|
||||
#include <xercesc/dom/DOMLSParser.hpp>
|
||||
#include <xercesc/dom/DOMLSParserFilter.hpp>
|
||||
#include <xercesc/dom/DOMConfiguration.hpp>
|
||||
#include <xercesc/dom/DOMLSResourceResolver.hpp>
|
||||
#include <xercesc/dom/DOMError.hpp>
|
||||
#include <xercesc/dom/DOMErrorHandler.hpp>
|
||||
#include <xercesc/dom/DOMImplementationLS.hpp>
|
||||
#include <xercesc/dom/DOMImplementationList.hpp>
|
||||
#include <xercesc/dom/DOMImplementationRegistry.hpp>
|
||||
#include <xercesc/dom/DOMImplementationSource.hpp>
|
||||
#include <xercesc/dom/DOMLSInput.hpp>
|
||||
#include <xercesc/dom/DOMLSOutput.hpp>
|
||||
#include <xercesc/dom/DOMLocator.hpp>
|
||||
#include <xercesc/dom/DOMPSVITypeInfo.hpp>
|
||||
#include <xercesc/dom/DOMStringList.hpp>
|
||||
#include <xercesc/dom/DOMTypeInfo.hpp>
|
||||
#include <xercesc/dom/DOMUserDataHandler.hpp>
|
||||
#include <xercesc/dom/DOMLSSerializer.hpp>
|
||||
#include <xercesc/dom/DOMLSSerializerFilter.hpp>
|
||||
|
||||
#include <xercesc/dom/DOMXPathEvaluator.hpp>
|
||||
#include <xercesc/dom/DOMXPathNSResolver.hpp>
|
||||
#include <xercesc/dom/DOMXPathException.hpp>
|
||||
#include <xercesc/dom/DOMXPathExpression.hpp>
|
||||
#include <xercesc/dom/DOMXPathResult.hpp>
|
||||
#include <xercesc/dom/DOMXPathNamespace.hpp>
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMAttr.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMATTR_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMElement;
|
||||
class DOMTypeInfo;
|
||||
|
||||
/**
|
||||
* The <code>DOMAttr</code> class refers to an attribute of an XML element.
|
||||
*
|
||||
* Typically the allowable values for the
|
||||
* attribute are defined in a documenttype definition.
|
||||
* <p><code>DOMAttr</code> objects inherit the <code>DOMNode</code> interface, but
|
||||
* since attributes are not actually child nodes of the elements they are associated with, the
|
||||
* DOM does not consider them part of the document tree. Thus, the
|
||||
* <code>DOMNode</code> attributes <code>parentNode</code>,
|
||||
* <code>previousSibling</code>, and <code>nextSibling</code> have a null
|
||||
* value for <code>DOMAttr</code> objects. The DOM takes the view that
|
||||
* attributes are properties of elements rather than having a separate
|
||||
* identity from the elements they are associated with; this should make it
|
||||
* more efficient to implement such features as default attributes associated
|
||||
* with all elements of a given type. Furthermore, attribute nodes
|
||||
* may not be immediate children of a <code>DOMDocumentFragment</code>. However,
|
||||
* they can be associated with <code>DOMElement</code> nodes contained within a
|
||||
* <code>DOMDocumentFragment</code>. In short, users of the DOM
|
||||
* need to be aware that <code>DOMAttr</code> nodes have some things in common
|
||||
* with other objects inheriting the <code>DOMNode</code> interface, but they
|
||||
* also are quite distinct.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMAttr: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMAttr() {}
|
||||
DOMAttr(const DOMAttr &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMAttr & operator = (const DOMAttr &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMAttr() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMAttr interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the name of this attribute.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getName() const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns true if the attribute received its value explicitly in the
|
||||
* XML document, or if a value was assigned programatically with
|
||||
* the setValue function. Returns false if the attribute value
|
||||
* came from the default value declared in the document's DTD.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual bool getSpecified() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the value of the attribute.
|
||||
*
|
||||
* The value of the attribute is returned as a string.
|
||||
* Character and general entity references are replaced with their values.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getValue() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the value of the attribute. A text node with the unparsed contents
|
||||
* of the string will be created.
|
||||
*
|
||||
* @param value The value of the DOM attribute to be set
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void setValue(const XMLCh *value) = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2. */
|
||||
//@{
|
||||
/**
|
||||
* The <code>DOMElement</code> node this attribute is attached to or
|
||||
* <code>null</code> if this attribute is not in use.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMElement *getOwnerElement() const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3. */
|
||||
//@{
|
||||
/**
|
||||
* Returns whether this attribute is known to be of type ID or not.
|
||||
* When it is and its value is unique, the ownerElement of this attribute
|
||||
* can be retrieved using getElementById on DOMDocument.
|
||||
*
|
||||
* @return <code>bool</code> stating if this <code>DOMAttr</code> is an ID
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual bool isId() const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the type information associated with this attribute.
|
||||
*
|
||||
* @return the <code>DOMTypeInfo</code> associated with this attribute
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual const DOMTypeInfo * getSchemaTypeInfo() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCDATASection.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCDATASECTION_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMText.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* CDATA sections are used to escape blocks of text containing characters that
|
||||
* would otherwise be regarded as markup. The only delimiter that is
|
||||
* recognized in a CDATA section is the "]]>" string that ends the CDATA
|
||||
* section. CDATA sections cannot be nested. Their primary purpose is for
|
||||
* including material such as XML fragments, without needing to escape all
|
||||
* the delimiters.
|
||||
* <p>The <code>data</code> attribute of the <code>DOMText</code> node holds
|
||||
* the text that is contained by the CDATA section. Note that this may
|
||||
* contain characters that need to be escaped outside of CDATA sections and
|
||||
* that, depending on the character encoding ("charset") chosen for
|
||||
* serialization, it may be impossible to write out some characters as part
|
||||
* of a CDATA section.
|
||||
* <p>The <code>DOMCDATASection</code> interface inherits from the
|
||||
* <code>DOMCharacterData</code> interface through the <code>DOMText</code>
|
||||
* interface. Adjacent <code>DOMCDATASection</code> nodes are not merged by use
|
||||
* of the <code>normalize</code> method of the <code>DOMNode</code> interface.
|
||||
* Because no markup is recognized within a <code>DOMCDATASection</code>,
|
||||
* character numeric references cannot be used as an escape mechanism when
|
||||
* serializing. Therefore, action needs to be taken when serializing a
|
||||
* <code>DOMCDATASection</code> with a character encoding where some of the
|
||||
* contained characters cannot be represented. Failure to do so would not
|
||||
* produce well-formed XML.One potential solution in the serialization
|
||||
* process is to end the CDATA section before the character, output the
|
||||
* character using a character reference or entity reference, and open a new
|
||||
* CDATA section for any further characters in the text node. Note, however,
|
||||
* that some code conversion libraries at the time of writing do not return
|
||||
* an error or exception when a character is missing from the encoding,
|
||||
* making the task of ensuring that data is not corrupted on serialization
|
||||
* more difficult.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMCDATASection: public DOMText {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMCDATASection() {}
|
||||
DOMCDATASection(const DOMCDATASection &other) : DOMText(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMCDATASection & operator = (const DOMCDATASection &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMCDATASection() {};
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCharacterData.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCHARACTERDATA_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCHARACTERDATA_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMCharacterData</code> interface extends DOMNode with a set of
|
||||
* attributes and methods for accessing character data in the DOM. For
|
||||
* clarity this set is defined here rather than on each object that uses
|
||||
* these attributes and methods. No DOM objects correspond directly to
|
||||
* <code>DOMCharacterData</code>, though <code>DOMText</code> and others do
|
||||
* inherit the interface from it. All <code>offsets</code> in this interface
|
||||
* start from <code>0</code>.
|
||||
* <p>As explained in the DOM spec, text strings in
|
||||
* the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In
|
||||
* the following, the term 16-bit units is used whenever necessary to
|
||||
* indicate that indexing on DOMCharacterData is done in 16-bit units.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMCharacterData: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMCharacterData() {}
|
||||
DOMCharacterData(const DOMCharacterData &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMCharacterData & operator = (const DOMCharacterData &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMCharacterData() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMCharacterData interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the character data of the node that implements this interface.
|
||||
*
|
||||
* The DOM implementation may not put arbitrary limits on the amount of data that
|
||||
* may be stored in a <code>DOMCharacterData</code> node. However,
|
||||
* implementation limits may mean that the entirety of a node's data may
|
||||
* not fit into a single <code>XMLCh* String</code>. In such cases, the user
|
||||
* may call <code>substringData</code> to retrieve the data in
|
||||
* appropriately sized pieces.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getData() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of characters that are available through <code>data</code> and
|
||||
* the <code>substringData</code> method below.
|
||||
*
|
||||
* This may have the value
|
||||
* zero, i.e., <code>CharacterData</code> nodes may be empty.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual XMLSize_t getLength() const = 0;
|
||||
|
||||
/**
|
||||
* Extracts a range of data from the node.
|
||||
*
|
||||
* @param offset Start offset of substring to extract.
|
||||
* @param count The number of characters to extract.
|
||||
* @return The specified substring. If the sum of <code>offset</code> and
|
||||
* <code>count</code> exceeds the <code>length</code>, then all
|
||||
* characters to the end of the data are returned.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
|
||||
* than the number of characters in <code>data</code>, or if the
|
||||
* specified <code>count</code> is negative.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * substringData(XMLSize_t offset,
|
||||
XMLSize_t count) const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// String methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Append the string to the end of the character data of the node.
|
||||
*
|
||||
* Upon success, <code>data</code> provides access to the concatenation of
|
||||
* <code>data</code> and the <code>XMLCh* String</code> specified.
|
||||
* @param arg The <code>XMLCh* String</code> to append.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void appendData(const XMLCh *arg) = 0;
|
||||
|
||||
/**
|
||||
* Insert a string at the specified character offset.
|
||||
*
|
||||
* @param offset The character offset at which to insert.
|
||||
* @param arg The <code>XMLCh* String</code> to insert.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
|
||||
* than the number of characters in <code>data</code>.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void insertData(XMLSize_t offset, const XMLCh *arg) = 0;
|
||||
|
||||
/**
|
||||
* Remove a range of characters from the node.
|
||||
*
|
||||
* Upon success,
|
||||
* <code>data</code> and <code>length</code> reflect the change.
|
||||
* @param offset The offset from which to remove characters.
|
||||
* @param count The number of characters to delete. If the sum of
|
||||
* <code>offset</code> and <code>count</code> exceeds <code>length</code>
|
||||
* then all characters from <code>offset</code> to the end of the data
|
||||
* are deleted.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
|
||||
* than the number of characters in <code>data</code>, or if the
|
||||
* specified <code>count</code> is negative.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void deleteData(XMLSize_t offset,
|
||||
XMLSize_t count) = 0;
|
||||
|
||||
/**
|
||||
* Replace the characters starting at the specified character offset with
|
||||
* the specified string.
|
||||
*
|
||||
* @param offset The offset from which to start replacing.
|
||||
* @param count The number of characters to replace. If the sum of
|
||||
* <code>offset</code> and <code>count</code> exceeds <code>length</code>
|
||||
* , then all characters to the end of the data are replaced (i.e., the
|
||||
* effect is the same as a <code>remove</code> method call with the same
|
||||
* range, followed by an <code>append</code> method invocation).
|
||||
* @param arg The <code>XMLCh* String</code> with which the range must be
|
||||
* replaced.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
|
||||
* than the number of characters in <code>data</code>, or if the
|
||||
* specified <code>count</code> is negative.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void replaceData(XMLSize_t offset,
|
||||
XMLSize_t count,
|
||||
const XMLCh *arg) = 0;
|
||||
|
||||
/**
|
||||
* Sets the character data of the node that implements this interface.
|
||||
*
|
||||
* @param data The <code>XMLCh* String</code> to set.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void setData(const XMLCh *data) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMComment.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCOMMENT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCOMMENT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMCharacterData.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* This interface inherits from <code>CharacterData</code> and represents the
|
||||
* content of a comment, i.e., all the characters between the starting '
|
||||
* <code><!--</code>' and ending '<code>--></code>'.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMComment: public DOMCharacterData {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMComment() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMComment(const DOMComment &);
|
||||
DOMComment & operator = (const DOMComment &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMComment() {};
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,454 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCONFIGURATION_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
#include <xercesc/dom/DOMStringList.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* The DOMConfiguration interface represents the configuration of
|
||||
* a document and maintains a table of recognized parameters.
|
||||
* Using the configuration, it is possible to change
|
||||
* Document.normalizeDocument behavior, such as replacing
|
||||
* CDATASection nodes with Text nodes or
|
||||
* specifying the type of the schema that must be used when the
|
||||
* validation of the Document is requested. DOMConfiguration
|
||||
* objects are also used in [DOM Level 3 Load and Save] in
|
||||
* the DOMLSParser and DOMLSSerializer interfaces.
|
||||
*
|
||||
* The DOMConfiguration distinguish two types of parameters:
|
||||
* boolean (boolean parameters) and DOMUserData
|
||||
* (parameters). The names used by the DOMConfiguration object are
|
||||
* defined throughout the DOM Level 3 specifications. Names are
|
||||
* case-insensitive. To avoid possible conflicts, as a
|
||||
* convention, names referring to boolean parameters and
|
||||
* parameters defined outside the DOM specification should be made
|
||||
* unique. Names are recommended to follow the XML name
|
||||
* production rule but it is not enforced by the DOM
|
||||
* implementation. DOM Level 3 Core Implementations are required
|
||||
* to recognize all boolean parameters and parameters defined in
|
||||
* this specification. Each boolean parameter state or parameter
|
||||
* value may then be supported or not by the implementation. Refer
|
||||
* to their definition to know if a state or a value must be
|
||||
* supported or not.
|
||||
*
|
||||
* Note: Parameters are similar to features and properties used in
|
||||
* SAX2 [SAX].
|
||||
*
|
||||
* The following list of parameters defined in the DOM:
|
||||
*
|
||||
* "error-handler"
|
||||
* [required]
|
||||
* A DOMErrorHandler object. If an error is
|
||||
* encountered in the document, the implementation will call
|
||||
* back the DOMErrorHandler registered using this
|
||||
* parameter.
|
||||
* When called, DOMError.relatedData will contain the
|
||||
* closest node to where the error occured. If the
|
||||
* implementation is unable to determine the node where the
|
||||
* error occurs, DOMError.relatedData will contain the
|
||||
* Document node. Mutations to the document from
|
||||
* within an error handler will result in implementation
|
||||
* dependent behaviour.
|
||||
*
|
||||
* "schema-type"
|
||||
* [optional]
|
||||
* A DOMString object containing an absolute URI and
|
||||
* representing the type of the schema language used to
|
||||
* validate a document against. Note that no lexical
|
||||
* checking is done on the absolute URI.
|
||||
* If this parameter is not set, a default value may be
|
||||
* provided by the implementation, based on the schema
|
||||
* languages supported and on the schema language used at
|
||||
* load time.
|
||||
*
|
||||
* Note: For XML Schema [XML Schema Part 1],
|
||||
* applications must use the value
|
||||
* "http://www.w3.org/2001/XMLSchema". For XML DTD
|
||||
* [XML 1.0], applications must use the value
|
||||
* "http://www.w3.org/TR/REC-xml". Other schema languages
|
||||
* are outside the scope of the W3C and therefore should
|
||||
* recommend an absolute URI in order to use this method.
|
||||
*
|
||||
* "schema-location"
|
||||
* [optional]
|
||||
* A DOMString object containing a list of URIs,
|
||||
* separated by white spaces (characters matching the
|
||||
* nonterminal production S defined in section 2.3
|
||||
* [XML 1.0]), that represents the schemas against
|
||||
* which validation should occur. The types of schemas
|
||||
* referenced in this list must match the type specified
|
||||
* with schema-type, otherwise the behaviour of an
|
||||
* implementation is undefined. If the schema type is XML
|
||||
* Schema [XML Schema Part 1], only one of the XML
|
||||
* Schemas in the list can be with no namespace.
|
||||
* If validation occurs against a namespace aware schema,
|
||||
* i.e. XML Schema, and the targetNamespace of a schema
|
||||
* (specified using this property) matches the
|
||||
* targetNamespace of a schema occurring in the instance
|
||||
* document, i.e in schemaLocation attribute, the schema
|
||||
* specified by the user using this property will be used
|
||||
* (i.e., in XML Schema the schemaLocation attribute in the
|
||||
* instance document or on the import element will be
|
||||
* effectively ignored).
|
||||
*
|
||||
* Note: It is illegal to set the schema-location parameter
|
||||
* if the schema-type parameter value is not set. It is
|
||||
* strongly recommended that DOMInputSource.baseURI will be
|
||||
* set, so that an implementation can successfully resolve
|
||||
* any external entities referenced.
|
||||
*
|
||||
* The following list of boolean parameters (features) defined in
|
||||
* the DOM:
|
||||
*
|
||||
* "canonical-form"
|
||||
*
|
||||
* true
|
||||
* [optional]
|
||||
* Canonicalize the document according to the rules
|
||||
* specified in [Canonical XML]. Note that this
|
||||
* is limited to what can be represented in the DOM.
|
||||
* In particular, there is no way to specify the order
|
||||
* of the attributes in the DOM.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* Do not canonicalize the document.
|
||||
*
|
||||
* "cdata-sections"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Keep CDATASection nodes in the document.
|
||||
*
|
||||
* false
|
||||
* [required]
|
||||
* Transform CDATASection nodes in the document
|
||||
* into Text nodes. The new Text node is
|
||||
* then combined with any adjacent Text node.
|
||||
*
|
||||
* "comments"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Keep Comment nodes in the document.
|
||||
*
|
||||
* false
|
||||
* [required]
|
||||
* Discard Comment nodes in the Document.
|
||||
*
|
||||
* "datatype-normalization"
|
||||
*
|
||||
* true
|
||||
* [required]
|
||||
* Exposed normalized values in the tree.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* Do not perform normalization on the tree.
|
||||
*
|
||||
* "discard-default-content"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Use whatever information available to the
|
||||
* implementation (i.e. XML schema, DTD, the specified
|
||||
* flag on Attr nodes, and so on) to decide what
|
||||
* attributes and content should be discarded or not.
|
||||
* Note that the specified flag on Attr nodes in
|
||||
* itself is not always reliable, it is only reliable
|
||||
* when it is set to false since the only case where
|
||||
* it can be set to false is if the attribute was
|
||||
* created by the implementation. The default content
|
||||
* won't be removed if an implementation does not have
|
||||
* any information available.
|
||||
*
|
||||
* false
|
||||
* [required]
|
||||
* Keep all attributes and all content.
|
||||
*
|
||||
* "entities"
|
||||
*
|
||||
* true
|
||||
* [required]
|
||||
* Keep EntityReference and Entity nodes
|
||||
* in the document.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* Remove all EntityReference and Entity
|
||||
* nodes from the document, putting the entity
|
||||
* expansions directly in their place. Text
|
||||
* nodes are into "normal" form. Only
|
||||
* EntityReference nodes to non-defined entities
|
||||
* are kept in the document.
|
||||
*
|
||||
* "infoset"
|
||||
*
|
||||
* true
|
||||
* [required]
|
||||
* Only keep in the document the information defined
|
||||
* in the XML Information Set [XML Information
|
||||
* set].
|
||||
* This forces the following features to false:
|
||||
* namespace-declarations, validate-if-schema,
|
||||
* entities, datatype-normalization, cdata-sections.
|
||||
* This forces the following features to true:
|
||||
* whitespace-in-element-content, comments,
|
||||
* namespaces.
|
||||
* Other features are not changed unless explicitly
|
||||
* specified in the description of the features.
|
||||
* Note that querying this feature with getFeature
|
||||
* returns true only if the individual features
|
||||
* specified above are appropriately set.
|
||||
*
|
||||
* false
|
||||
* Setting infoset to false has no effect.
|
||||
*
|
||||
* "namespaces"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Perform the namespace processing as defined in
|
||||
* [XML Namespaces].
|
||||
*
|
||||
* false
|
||||
* [optional]
|
||||
* Do not perform the namespace processing.
|
||||
*
|
||||
* "namespace-declarations"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Include namespace declaration attributes, specified
|
||||
* or defaulted from the schema or the DTD, in the
|
||||
* document. See also the section Declaring
|
||||
* Namespaces in [XML Namespaces].
|
||||
*
|
||||
* false
|
||||
* [required]
|
||||
* Discard all namespace declaration attributes. The
|
||||
* Namespace prefixes are retained even if this
|
||||
* feature is set to false.
|
||||
*
|
||||
* "normalize-characters"
|
||||
*
|
||||
* true
|
||||
* [optional]
|
||||
* Perform the W3C Text Normalization of the
|
||||
* characters [CharModel] in the document.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* Do not perform character normalization.
|
||||
*
|
||||
* "split-cdata-sections"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Split CDATA sections containing the CDATA section
|
||||
* termination marker ']]>'. When a CDATA section is
|
||||
* split a warning is issued.
|
||||
*
|
||||
* false
|
||||
* [required]
|
||||
* Signal an error if a CDATASection contains an
|
||||
* unrepresentable character.
|
||||
*
|
||||
* "validate"
|
||||
*
|
||||
* true
|
||||
* [optional]
|
||||
* Require the validation against a schema (i.e. XML
|
||||
* schema, DTD, any other type or representation of
|
||||
* schema) of the document as it is being normalized
|
||||
* as defined by [XML 1.0]. If validation errors
|
||||
* are found, or no schema was found, the error
|
||||
* handler is notified. Note also that normalized
|
||||
* values will not be exposed to the schema in used
|
||||
* unless the feature datatype-normalization is true.
|
||||
*
|
||||
* Note: validate-if-schema and validate are mutually
|
||||
* exclusive, setting one of them to true will set the
|
||||
* other one to false.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* Only XML 1.0 non-validating processing must be
|
||||
* done. Note that validation might still happen if
|
||||
* validate-if-schema is true.
|
||||
*
|
||||
* "validate-if-schema"
|
||||
*
|
||||
* true
|
||||
* [optional]
|
||||
* Enable validation only if a declaration for the
|
||||
* document element can be found (independently of
|
||||
* where it is found, i.e. XML schema, DTD, or any
|
||||
* other type or representation of schema). If
|
||||
* validation errors are found, the error handler is
|
||||
* notified. Note also that normalized values will not
|
||||
* be exposed to the schema in used unless the feature
|
||||
* datatype-normalization is true.
|
||||
*
|
||||
* Note: validate-if-schema and validate are mutually
|
||||
* exclusive, setting one of them to true will set the
|
||||
* other one to false.
|
||||
*
|
||||
* false
|
||||
* [required] (default)
|
||||
* No validation should be performed if the document
|
||||
* has a schema. Note that validation must still
|
||||
* happen if validate is true.
|
||||
*
|
||||
* "element-content-whitespace"
|
||||
*
|
||||
* true
|
||||
* [required] (default)
|
||||
* Keep all white spaces in the document.
|
||||
*
|
||||
* false
|
||||
* [optional]
|
||||
* Discard white space in element content while
|
||||
* normalizing. The implementation is expected to use
|
||||
* the isWhitespaceInElementContent flag on Text
|
||||
* nodes to determine if a text node should be written
|
||||
* out or not.
|
||||
*
|
||||
* The resolutions of entities is done using Document.baseURI.
|
||||
* However, when the features "LS-Load" or "LS-Save" defined in
|
||||
* [DOM Level 3 Load and Save] are supported by the DOM
|
||||
* implementation, the parameter "entity-resolver" can also be
|
||||
* used on DOMConfiguration objects attached to Document
|
||||
* nodes. If this parameter is set,
|
||||
* Document.normalizeDocument will invoke the entity
|
||||
* resolver instead of using Document.baseURI.
|
||||
*/
|
||||
class CDOM_EXPORT DOMConfiguration
|
||||
{
|
||||
protected:
|
||||
//-----------------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMConfiguration() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMConfiguration(const DOMConfiguration &);
|
||||
DOMConfiguration & operator = (const DOMConfiguration &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/** Set the value of a parameter.
|
||||
* @param name The name of the parameter to set.
|
||||
* @param value The new value or null if the user wishes to unset the
|
||||
* parameter. While the type of the value parameter is defined as
|
||||
* <code>DOMUserData</code>, the object type must match the type defined
|
||||
* by the definition of the parameter. For example, if the parameter is
|
||||
* "error-handler", the value must be of type <code>DOMErrorHandler</code>
|
||||
* @exception DOMException (NOT_SUPPORTED_ERR) Raised when the
|
||||
* parameter name is recognized but the requested value cannot be set.
|
||||
* @exception DOMException (NOT_FOUND_ERR) Raised when the
|
||||
* parameter name is not recognized.
|
||||
* @since DOM level 3
|
||||
**/
|
||||
virtual void setParameter(const XMLCh* name, const void* value) = 0;
|
||||
virtual void setParameter(const XMLCh* name, bool value) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/** Return the value of a parameter if known.
|
||||
* @param name The name of the parameter.
|
||||
* @return The current object associated with the specified parameter or
|
||||
* null if no object has been associated or if the parameter is not
|
||||
* supported.
|
||||
* @exception DOMException (NOT_FOUND_ERR) Raised when the i
|
||||
* boolean parameter
|
||||
* name is not recognized.
|
||||
* @since DOM level 3
|
||||
**/
|
||||
virtual const void* getParameter(const XMLCh* name) const = 0;
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Query methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/** Check if setting a parameter to a specific value is supported.
|
||||
* @param name The name of the parameter to check.
|
||||
* @param value An object. if null, the returned value is true.
|
||||
* @return true if the parameter could be successfully set to the specified
|
||||
* value, or false if the parameter is not recognized or the requested value
|
||||
* is not supported. This does not change the current value of the parameter
|
||||
* itself.
|
||||
* @since DOM level 3
|
||||
**/
|
||||
virtual bool canSetParameter(const XMLCh* name, const void* value) const = 0;
|
||||
virtual bool canSetParameter(const XMLCh* name, bool value) const = 0;
|
||||
|
||||
/**
|
||||
* The list of the parameters supported by this DOMConfiguration object and
|
||||
* for which at least one value can be set by the application.
|
||||
* Note that this list can also contain parameter names defined outside this specification.
|
||||
*
|
||||
* @return The list of parameters that can be used with setParameter/getParameter
|
||||
* @since DOM level 3
|
||||
**/
|
||||
virtual const DOMStringList* getParameterNames() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMConfiguration() {};
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMConfiguration.hpp
|
||||
*/
|
||||
@@ -1,819 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocument.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMDocumentRange.hpp>
|
||||
#include <xercesc/dom/DOMDocumentTraversal.hpp>
|
||||
#include <xercesc/dom/DOMXPathEvaluator.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMConfiguration;
|
||||
class DOMDocumentType;
|
||||
class DOMElement;
|
||||
class DOMDocumentFragment;
|
||||
class DOMComment;
|
||||
class DOMCDATASection;
|
||||
class DOMProcessingInstruction;
|
||||
class DOMAttr;
|
||||
class DOMEntity;
|
||||
class DOMEntityReference;
|
||||
class DOMImplementation;
|
||||
class DOMNodeFilter;
|
||||
class DOMNodeList;
|
||||
class DOMNotation;
|
||||
class DOMText;
|
||||
class DOMNode;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMDocument</code> interface represents the entire XML
|
||||
* document. Conceptually, it is the root of the document tree, and provides
|
||||
* the primary access to the document's data.
|
||||
* <p>Since elements, text nodes, comments, processing instructions, etc.
|
||||
* cannot exist outside the context of a <code>DOMDocument</code>, the
|
||||
* <code>DOMDocument</code> interface also contains the factory methods needed
|
||||
* to create these objects. The <code>DOMNode</code> objects created have a
|
||||
* <code>ownerDocument</code> attribute which associates them with the
|
||||
* <code>DOMDocument</code> within whose context they were created.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMDocument: public DOMDocumentRange,
|
||||
public DOMXPathEvaluator,
|
||||
public DOMDocumentTraversal,
|
||||
public DOMNode {
|
||||
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMDocument() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMDocument(const DOMDocument &);
|
||||
DOMDocument & operator = (const DOMDocument &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMDocument() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMDocument interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
/**
|
||||
* Creates an element of the type specified. Note that the instance
|
||||
* returned implements the <code>DOMElement</code> interface, so attributes
|
||||
* can be specified directly on the returned object.
|
||||
* <br>In addition, if there are known attributes with default values,
|
||||
* <code>DOMAttr</code> nodes representing them are automatically created
|
||||
* and attached to the element.
|
||||
* <br>To create an element with a qualified name and namespace URI, use
|
||||
* the <code>createElementNS</code> method.
|
||||
* @param tagName The name of the element type to instantiate. For XML,
|
||||
* this is case-sensitive.
|
||||
* @return A new <code>DOMElement</code> object with the
|
||||
* <code>nodeName</code> attribute set to <code>tagName</code>, and
|
||||
* <code>localName</code>, <code>prefix</code>, and
|
||||
* <code>namespaceURI</code> set to <code>null</code>.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified name contains an
|
||||
* illegal character.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMElement *createElement(const XMLCh *tagName) = 0;
|
||||
|
||||
/**
|
||||
* Creates an empty <code>DOMDocumentFragment</code> object.
|
||||
* @return A new <code>DOMDocumentFragment</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMDocumentFragment *createDocumentFragment() = 0;
|
||||
|
||||
/**
|
||||
* Creates a <code>DOMText</code> node given the specified string.
|
||||
* @param data The data for the node.
|
||||
* @return The new <code>DOMText</code> object.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMText *createTextNode(const XMLCh *data) = 0;
|
||||
|
||||
/**
|
||||
* Creates a <code>DOMComment</code> node given the specified string.
|
||||
* @param data The data for the node.
|
||||
* @return The new <code>DOMComment</code> object.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMComment *createComment(const XMLCh *data) = 0;
|
||||
|
||||
/**
|
||||
* Creates a <code>DOMCDATASection</code> node whose value is the specified
|
||||
* string.
|
||||
* @param data The data for the <code>DOMCDATASection</code> contents.
|
||||
* @return The new <code>DOMCDATASection</code> object.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMCDATASection *createCDATASection(const XMLCh *data) = 0;
|
||||
|
||||
/**
|
||||
* Creates a <code>DOMProcessingInstruction</code> node given the specified
|
||||
* name and data strings.
|
||||
* @param target The target part of the processing instruction.
|
||||
* @param data The data for the node.
|
||||
* @return The new <code>DOMProcessingInstruction</code> object.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified target contains an
|
||||
* illegal character.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMProcessingInstruction *createProcessingInstruction(const XMLCh *target,
|
||||
const XMLCh *data) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Creates an <code>DOMAttr</code> of the given name. Note that the
|
||||
* <code>DOMAttr</code> instance can then be set on an <code>DOMElement</code>
|
||||
* using the <code>setAttributeNode</code> method.
|
||||
* <br>To create an attribute with a qualified name and namespace URI, use
|
||||
* the <code>createAttributeNS</code> method.
|
||||
* @param name The name of the attribute.
|
||||
* @return A new <code>DOMAttr</code> object with the <code>nodeName</code>
|
||||
* attribute set to <code>name</code>, and <code>localName</code>,
|
||||
* <code>prefix</code>, and <code>namespaceURI</code> set to
|
||||
* <code>null</code>. The value of the attribute is the empty string.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified name contains an
|
||||
* illegal character.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMAttr *createAttribute(const XMLCh *name) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Creates an <code>DOMEntityReference</code> object. In addition, if the
|
||||
* referenced entity is known, the child list of the
|
||||
* <code>DOMEntityReference</code> node is made the same as that of the
|
||||
* corresponding <code>DOMEntity</code> node.If any descendant of the
|
||||
* <code>DOMEntity</code> node has an unbound namespace prefix, the
|
||||
* corresponding descendant of the created <code>DOMEntityReference</code>
|
||||
* node is also unbound; (its <code>namespaceURI</code> is
|
||||
* <code>null</code>). The DOM Level 2 does not support any mechanism to
|
||||
* resolve namespace prefixes.
|
||||
* @param name The name of the entity to reference.
|
||||
* @return The new <code>DOMEntityReference</code> object.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified name contains an
|
||||
* illegal character.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMEntityReference *createEntityReference(const XMLCh *name) = 0;
|
||||
|
||||
/**
|
||||
* The Document Type Declaration (see <code>DOMDocumentType</code>)
|
||||
* associated with this document. For XML
|
||||
* documents without a document type declaration this returns
|
||||
* <code>null</code>. The DOM Level 2 does not support editing the
|
||||
* Document Type Declaration. <code>docType</code> cannot be altered in
|
||||
* any way, including through the use of methods inherited from the
|
||||
* <code>DOMNode</code> interface, such as <code>insertNode</code> or
|
||||
* <code>removeNode</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMDocumentType *getDoctype() const = 0;
|
||||
|
||||
/**
|
||||
* The <code>DOMImplementation</code> object that handles this document. A
|
||||
* DOM application may use objects from multiple implementations.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMImplementation *getImplementation() const = 0;
|
||||
|
||||
/**
|
||||
* This is a convenience attribute that allows direct access to the child
|
||||
* node that is the root element of the document.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMElement *getDocumentElement() const = 0;
|
||||
|
||||
/**
|
||||
* Returns a <code>DOMNodeList</code> of all the <code>DOMElement(s)</code> with a
|
||||
* given tag name in the order in which they are encountered in a
|
||||
* preorder traversal of the <code>DOMDocument</code> tree.
|
||||
*
|
||||
* The returned node list is "live", in that changes
|
||||
* to the document tree made after a nodelist was initially
|
||||
* returned will be immediately reflected in the node list.
|
||||
* @param tagname The name of the tag to match on. The special value "*"
|
||||
* matches all tags.
|
||||
* @return A new <code>DOMNodeList</code> object containing all the matched
|
||||
* <code>DOMElement(s)</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNodeList *getElementsByTagName(const XMLCh *tagname) const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2. */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Imports a node from another document to this document. The returned
|
||||
* node has no parent; (<code>parentNode</code> is <code>null</code>).
|
||||
* The source node is not altered or removed from the original document;
|
||||
* this method creates a new copy of the source node.
|
||||
* <br>For all nodes, importing a node creates a node object owned by the
|
||||
* importing document, with attribute values identical to the source
|
||||
* node's <code>nodeName</code> and <code>nodeType</code>, plus the
|
||||
* attributes related to namespaces (<code>prefix</code>,
|
||||
* <code>localName</code>, and <code>namespaceURI</code>). As in the
|
||||
* <code>cloneNode</code> operation on a <code>DOMNode</code>, the source
|
||||
* node is not altered.
|
||||
* <br>Additional information is copied as appropriate to the
|
||||
* <code>nodeType</code>, attempting to mirror the behavior expected if
|
||||
* a fragment of XML source was copied from one document to
|
||||
* another, recognizing that the two documents may have different DTDs
|
||||
* in the XML case. The following list describes the specifics for each
|
||||
* type of node.
|
||||
* <dl>
|
||||
* <dt>ATTRIBUTE_NODE</dt>
|
||||
* <dd>The <code>ownerElement</code> attribute
|
||||
* is set to <code>null</code> and the <code>specified</code> flag is
|
||||
* set to <code>true</code> on the generated <code>DOMAttr</code>. The
|
||||
* descendants of the source <code>DOMAttr</code> are recursively imported
|
||||
* and the resulting nodes reassembled to form the corresponding subtree.
|
||||
* Note that the <code>deep</code> parameter has no effect on
|
||||
* <code>DOMAttr</code> nodes; they always carry their children with them
|
||||
* when imported.</dd>
|
||||
* <dt>DOCUMENT_FRAGMENT_NODE</dt>
|
||||
* <dd>If the <code>deep</code> option
|
||||
* was set to <code>true</code>, the descendants of the source element
|
||||
* are recursively imported and the resulting nodes reassembled to form
|
||||
* the corresponding subtree. Otherwise, this simply generates an empty
|
||||
* <code>DOMDocumentFragment</code>.</dd>
|
||||
* <dt>DOCUMENT_NODE</dt>
|
||||
* <dd><code>DOMDocument</code>
|
||||
* nodes cannot be imported.</dd>
|
||||
* <dt>DOCUMENT_TYPE_NODE</dt>
|
||||
* <dd><code>DOMDocumentType</code>
|
||||
* nodes cannot be imported.</dd>
|
||||
* <dt>ELEMENT_NODE</dt>
|
||||
* <dd>Specified attribute nodes of the
|
||||
* source element are imported, and the generated <code>DOMAttr</code>
|
||||
* nodes are attached to the generated <code>DOMElement</code>. Default
|
||||
* attributes are not copied, though if the document being imported into
|
||||
* defines default attributes for this element name, those are assigned.
|
||||
* If the <code>importNode</code> <code>deep</code> parameter was set to
|
||||
* <code>true</code>, the descendants of the source element are
|
||||
* recursively imported and the resulting nodes reassembled to form the
|
||||
* corresponding subtree.</dd>
|
||||
* <dt>ENTITY_NODE</dt>
|
||||
* <dd><code>DOMEntity</code> nodes can be
|
||||
* imported, however in the current release of the DOM the
|
||||
* <code>DOMDocumentType</code> is readonly. Ability to add these imported
|
||||
* nodes to a <code>DOMDocumentType</code> will be considered for addition
|
||||
* to a future release of the DOM.On import, the <code>publicId</code>,
|
||||
* <code>systemId</code>, and <code>notationName</code> attributes are
|
||||
* copied. If a <code>deep</code> import is requested, the descendants
|
||||
* of the the source <code>DOMEntity</code> are recursively imported and
|
||||
* the resulting nodes reassembled to form the corresponding subtree.</dd>
|
||||
* <dt>
|
||||
* ENTITY_REFERENCE_NODE</dt>
|
||||
* <dd>Only the <code>DOMEntityReference</code> itself is
|
||||
* copied, even if a <code>deep</code> import is requested, since the
|
||||
* source and destination documents might have defined the entity
|
||||
* differently. If the document being imported into provides a
|
||||
* definition for this entity name, its value is assigned.</dd>
|
||||
* <dt>NOTATION_NODE</dt>
|
||||
* <dd>
|
||||
* <code>DOMNotation</code> nodes can be imported, however in the current
|
||||
* release of the DOM the <code>DOMDocumentType</code> is readonly. Ability
|
||||
* to add these imported nodes to a <code>DOMDocumentType</code> will be
|
||||
* considered for addition to a future release of the DOM.On import, the
|
||||
* <code>publicId</code> and <code>systemId</code> attributes are copied.
|
||||
* Note that the <code>deep</code> parameter has no effect on
|
||||
* <code>DOMNotation</code> nodes since they never have any children.</dd>
|
||||
* <dt>
|
||||
* PROCESSING_INSTRUCTION_NODE</dt>
|
||||
* <dd>The imported node copies its
|
||||
* <code>target</code> and <code>data</code> values from those of the
|
||||
* source node.</dd>
|
||||
* <dt>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE</dt>
|
||||
* <dd>These three
|
||||
* types of nodes inheriting from <code>DOMCharacterData</code> copy their
|
||||
* <code>data</code> and <code>length</code> attributes from those of
|
||||
* the source node.</dd>
|
||||
* </dl>
|
||||
* @param importedNode The node to import.
|
||||
* @param deep If <code>true</code>, recursively import the subtree under
|
||||
* the specified node; if <code>false</code>, import only the node
|
||||
* itself, as explained above. This has no effect on <code>DOMAttr</code>
|
||||
* , <code>DOMEntityReference</code>, and <code>DOMNotation</code> nodes.
|
||||
* @return The imported node that belongs to this <code>DOMDocument</code>.
|
||||
* @exception DOMException
|
||||
* NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
|
||||
* supported.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode *importNode(const DOMNode *importedNode, bool deep) = 0;
|
||||
|
||||
/**
|
||||
* Creates an element of the given qualified name and namespace URI.
|
||||
* @param namespaceURI The namespace URI of the element to create.
|
||||
* @param qualifiedName The qualified name of the element type to
|
||||
* instantiate.
|
||||
* @return A new <code>DOMElement</code> object with the following
|
||||
* attributes:
|
||||
* <table border='1'>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>Attribute</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>Value</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.nodeName</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>qualifiedName</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.namespaceURI</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>namespaceURI</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.prefix</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>prefix, extracted
|
||||
* from <code>qualifiedName</code>, or <code>null</code> if there is
|
||||
* no prefix</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.localName</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>local name, extracted from
|
||||
* <code>qualifiedName</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMElement.tagName</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>qualifiedName</code></td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
||||
* contains an illegal character, per the XML 1.0 specification .
|
||||
* <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
|
||||
* malformed per the Namespaces in XML specification, if the
|
||||
* <code>qualifiedName</code> has a prefix and the
|
||||
* <code>namespaceURI</code> is <code>null</code>, or if the
|
||||
* <code>qualifiedName</code> has a prefix that is "xml" and the
|
||||
* <code>namespaceURI</code> is different from "
|
||||
* http://www.w3.org/XML/1998/namespace" .
|
||||
* <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
|
||||
* support the <code>"XML"</code> feature, since namespaces were
|
||||
* defined by XML.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMElement *createElementNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName) = 0;
|
||||
|
||||
/**
|
||||
* Creates an attribute of the given qualified name and namespace URI.
|
||||
* @param namespaceURI The namespace URI of the attribute to create.
|
||||
* @param qualifiedName The qualified name of the attribute to
|
||||
* instantiate.
|
||||
* @return A new <code>DOMAttr</code> object with the following attributes:
|
||||
* <table border='1'>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>Attribute</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>Value</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.nodeName</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>qualifiedName</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>DOMNode.namespaceURI</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>namespaceURI</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>DOMNode.prefix</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>prefix, extracted from
|
||||
* <code>qualifiedName</code>, or <code>null</code> if there is no
|
||||
* prefix</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.localName</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>local name, extracted from
|
||||
* <code>qualifiedName</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMAttr.name</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>qualifiedName</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'><code>DOMNode.nodeValue</code></td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>the empty
|
||||
* string</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
||||
* contains an illegal character, per the XML 1.0 specification .
|
||||
* <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
|
||||
* malformed per the Namespaces in XML specification, if the
|
||||
* <code>qualifiedName</code> has a prefix and the
|
||||
* <code>namespaceURI</code> is <code>null</code>, if the
|
||||
* <code>qualifiedName</code> has a prefix that is "xml" and the
|
||||
* <code>namespaceURI</code> is different from "
|
||||
* http://www.w3.org/XML/1998/namespace", or if the
|
||||
* <code>qualifiedName</code>, or its prefix, is "xmlns" and the
|
||||
* <code>namespaceURI</code> is different from "
|
||||
* http://www.w3.org/2000/xmlns/".
|
||||
* <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
|
||||
* support the <code>"XML"</code> feature, since namespaces were
|
||||
* defined by XML.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMAttr *createAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName) = 0;
|
||||
|
||||
/**
|
||||
* Returns a <code>DOMNodeList</code> of all the <code>DOMElement(s)</code> with a
|
||||
* given local name and namespace URI in the order in which they are
|
||||
* encountered in a preorder traversal of the <code>DOMDocument</code> tree.
|
||||
* @param namespaceURI The namespace URI of the elements to match on. The
|
||||
* special value "*" matches all namespaces.
|
||||
* @param localName The local name of the elements to match on. The
|
||||
* special value "*" matches all local names.
|
||||
* @return A new <code>DOMNodeList</code> object containing all the matched
|
||||
* <code>DOMElement(s)</code>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNodeList *getElementsByTagNameNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
|
||||
/**
|
||||
* Returns the <code>DOMElement</code> whose <code>ID</code> is given by
|
||||
* <code>elementId</code>. If no such element exists, returns
|
||||
* <code>null</code>. Behavior is not defined if more than one element
|
||||
* has this <code>ID</code>. The DOM implementation must have
|
||||
* information that says which attributes are of type ID. Attributes
|
||||
* with the name "ID" are not of type ID unless so defined.
|
||||
* Implementations that do not know whether attributes are of type ID or
|
||||
* not are expected to return <code>null</code>.
|
||||
* @param elementId The unique <code>id</code> value for an element.
|
||||
* @return The matching element.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMElement * getElementById(const XMLCh *elementId) const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3. */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* An attribute specifying the encoding used for this document at the time of the parsing.
|
||||
* This is <code>null</code> when it is not known, such as when the DOMDocument was created in memory.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getInputEncoding() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the XML declaration, the encoding of this document.
|
||||
* This is <code>null</code> when unspecified or when it is not known, such as when the
|
||||
* DOMDocument was created in memory.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getXmlEncoding() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the XML declaration, whether this document is standalone.
|
||||
* This is <code>false</code> when unspecified.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool getXmlStandalone() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the XML declaration, whether this
|
||||
* document is standalone.
|
||||
* <br> This attribute represents the property [standalone] defined in .
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setXmlStandalone(bool standalone) = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the XML declaration, the version
|
||||
* number of this document. This is <code>null</code> when unspecified.
|
||||
* <br> This attribute represents the property [version] defined in .
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getXmlVersion() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the XML declaration, the version
|
||||
* number of this document. This is <code>null</code> when unspecified.
|
||||
* <br> This attribute represents the property [version] defined in .
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setXmlVersion(const XMLCh* version) = 0;
|
||||
|
||||
/**
|
||||
* The location of the document or <code>null</code> if undefined.
|
||||
* <br>Beware that when the <code>DOMDocument</code> supports the feature
|
||||
* "HTML" , the href attribute of the HTML BASE element takes precedence
|
||||
* over this attribute.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getDocumentURI() const = 0;
|
||||
/**
|
||||
* The location of the document or <code>null</code> if undefined.
|
||||
* <br>Beware that when the <code>DOMDocument</code> supports the feature
|
||||
* "HTML" , the href attribute of the HTML BASE element takes precedence
|
||||
* over this attribute.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setDocumentURI(const XMLCh* documentURI) = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying whether errors checking is enforced or not.
|
||||
* When set to <code>false</code>, the implementation is free to not
|
||||
* test every possible error case normally defined on DOM operations,
|
||||
* and not raise any <code>DOMException</code>. In case of error, the
|
||||
* behavior is undefined. This attribute is <code>true</code> by
|
||||
* defaults.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool getStrictErrorChecking() const = 0;
|
||||
/**
|
||||
* An attribute specifying whether errors checking is enforced or not.
|
||||
* When set to <code>false</code>, the implementation is free to not
|
||||
* test every possible error case normally defined on DOM operations,
|
||||
* and not raise any <code>DOMException</code>. In case of error, the
|
||||
* behavior is undefined. This attribute is <code>true</code> by
|
||||
* defaults.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setStrictErrorChecking(bool strictErrorChecking) = 0;
|
||||
|
||||
/**
|
||||
* Rename an existing node. When possible this simply changes the name of
|
||||
* the given node, otherwise this creates a new node with the specified
|
||||
* name and replaces the existing node with the new node as described
|
||||
* below. This only applies to nodes of type <code>ELEMENT_NODE</code>
|
||||
* and <code>ATTRIBUTE_NODE</code>.
|
||||
* <br>When a new node is created, the following operations are performed:
|
||||
* the new node is created, any registered event listener is registered
|
||||
* on the new node, any user data attached to the old node is removed
|
||||
* from that node, the old node is removed from its parent if it has
|
||||
* one, the children are moved to the new node, if the renamed node is
|
||||
* an <code>DOMElement</code> its attributes are moved to the new node, the
|
||||
* new node is inserted at the position the old node used to have in its
|
||||
* parent's child nodes list if it has one, the user data that was
|
||||
* attached to the old node is attach to the new node, the user data
|
||||
* event <code>NODE_RENAMED</code> is fired.
|
||||
* <br>When the node being renamed is an <code>DOMAttr</code> that is
|
||||
* attached to an <code>DOMElement</code>, the node is first removed from
|
||||
* the <code>DOMElement</code> attributes map. Then, once renamed, either
|
||||
* by modifying the existing node or creating a new one as described
|
||||
* above, it is put back.
|
||||
*
|
||||
* @param n The node to rename.
|
||||
* @param namespaceURI The new namespaceURI.
|
||||
* @param qualifiedName The new qualified name.
|
||||
* @return The renamed node. This is either the specified node or the new
|
||||
* node that was created to replace the specified node.
|
||||
* @exception DOMException
|
||||
* NOT_SUPPORTED_ERR: Raised when the type of the specified node is
|
||||
* neither <code>ELEMENT_NODE</code> nor <code>ATTRIBUTE_NODE</code>.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised when the specified node was created
|
||||
* from a different document than this document.
|
||||
* <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
|
||||
* malformed per the Namespaces in XML specification, if the
|
||||
* <code>qualifiedName</code> has a prefix and the
|
||||
* <code>namespaceURI</code> is <code>null</code>, or if the
|
||||
* <code>qualifiedName</code> has a prefix that is "xml" and the
|
||||
* <code>namespaceURI</code> is different from "
|
||||
* http://www.w3.org/XML/1998/namespace" . Also raised, when the node
|
||||
* being renamed is an attribute, if the <code>qualifiedName</code>,
|
||||
* or its prefix, is "xmlns" and the <code>namespaceURI</code> is
|
||||
* different from "http://www.w3.org/2000/xmlns/".
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* qualifiedName) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Changes the <code>ownerDocument</code> of a node, its children, as well
|
||||
* as the attached attribute nodes if there are any. If the node has a
|
||||
* parent it is first removed from its parent child list. This
|
||||
* effectively allows moving a subtree from one document to another. The
|
||||
* following list describes the specifics for each type of node.
|
||||
*
|
||||
* <dl>
|
||||
* <dt>
|
||||
* ATTRIBUTE_NODE</dt>
|
||||
* <dd>The <code>ownerElement</code> attribute is set to
|
||||
* <code>null</code> and the <code>specified</code> flag is set to
|
||||
* <code>true</code> on the adopted <code>DOMAttr</code>. The descendants
|
||||
* of the source <code>DOMAttr</code> are recursively adopted.</dd>
|
||||
* <dt>
|
||||
* DOCUMENT_FRAGMENT_NODE</dt>
|
||||
* <dd>The descendants of the source node are
|
||||
* recursively adopted.</dd>
|
||||
* <dt>DOCUMENT_NODE</dt>
|
||||
* <dd><code>DOMDocument</code> nodes cannot
|
||||
* be adopted.</dd>
|
||||
* <dt>DOCUMENT_TYPE_NODE</dt>
|
||||
* <dd><code>DOMDocumentType</code> nodes cannot
|
||||
* be adopted.</dd>
|
||||
* <dt>ELEMENT_NODE</dt>
|
||||
* <dd>Specified attribute nodes of the source
|
||||
* element are adopted, and the generated <code>DOMAttr</code> nodes.
|
||||
* Default attributes are discarded, though if the document being
|
||||
* adopted into defines default attributes for this element name, those
|
||||
* are assigned. The descendants of the source element are recursively
|
||||
* adopted.</dd>
|
||||
* <dt>ENTITY_NODE</dt>
|
||||
* <dd><code>DOMEntity</code> nodes cannot be adopted.</dd>
|
||||
* <dt>
|
||||
* ENTITY_REFERENCE_NODE</dt>
|
||||
* <dd>Only the <code>DOMEntityReference</code> node
|
||||
* itself is adopted, the descendants are discarded, since the source
|
||||
* and destination documents might have defined the entity differently.
|
||||
* If the document being imported into provides a definition for this
|
||||
* entity name, its value is assigned.</dd>
|
||||
* <dt>NOTATION_NODE</dt>
|
||||
* <dd><code>DOMNotation</code>
|
||||
* nodes cannot be adopted.</dd>
|
||||
* <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE,
|
||||
* CDATA_SECTION_NODE, COMMENT_NODE</dt>
|
||||
* <dd>These nodes can all be adopted. No
|
||||
* specifics.</dd>
|
||||
* </dl>
|
||||
* @param source The node to move into this document.
|
||||
* @return The adopted node, or <code>null</code> if this operation
|
||||
* fails, such as when the source node comes from a different
|
||||
* implementation.
|
||||
* @exception DOMException
|
||||
* NOT_SUPPORTED_ERR: Raised if the source node is of type
|
||||
* <code>DOCUMENT</code>, <code>DOCUMENT_TYPE</code>.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is
|
||||
* readonly.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMNode* adoptNode(DOMNode* source) = 0;
|
||||
|
||||
/**
|
||||
* This method acts as if the document was going through a save and load
|
||||
* cycle, putting the document in a "normal" form. The actual result
|
||||
* depends on the features being set. See <code>DOMConfiguration</code> for
|
||||
* details.
|
||||
*
|
||||
* <br>Noticeably this method normalizes <code>DOMText</code> nodes, makes
|
||||
* the document "namespace wellformed", according to the algorithm
|
||||
* described below in pseudo code, by adding missing namespace
|
||||
* declaration attributes and adding or changing namespace prefixes,
|
||||
* updates the replacement tree of <code>DOMEntityReference</code> nodes,
|
||||
* normalizes attribute values, etc.
|
||||
* <br>Mutation events, when supported, are generated to reflect the
|
||||
* changes occurring on the document.
|
||||
* Note that this is a partial implementation. Not all the required features are implemented.
|
||||
* Currently <code>DOMAttr</code> and <code>DOMText</code> nodes are normalized.
|
||||
* Features to remove <code>DOMComment</code> and <code>DOMCDATASection</code> work.
|
||||
* @since DOM Level 3
|
||||
*
|
||||
*/
|
||||
virtual void normalizeDocument() = 0;
|
||||
|
||||
|
||||
/**
|
||||
* The configuration used when DOMDocument::normalizeDocument is invoked.
|
||||
*
|
||||
* @return The <code>DOMConfiguration</code> from this <code>DOMDocument</code>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMConfiguration* getDOMConfig() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard extension */
|
||||
//@{
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Create a new entity.
|
||||
* @param name The name of the entity to instantiate
|
||||
*
|
||||
*/
|
||||
virtual DOMEntity *createEntity(const XMLCh *name) = 0;
|
||||
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Create a DOMDocumentType node.
|
||||
* @return A <code>DOMDocumentType</code> that references the newly
|
||||
* created DOMDocumentType node.
|
||||
*
|
||||
*/
|
||||
virtual DOMDocumentType *createDocumentType(const XMLCh *name) = 0;
|
||||
|
||||
/***
|
||||
* Provide default implementation to maintain source code compatibility
|
||||
***/
|
||||
virtual DOMDocumentType* createDocumentType(const XMLCh *qName,
|
||||
const XMLCh*, //publicId,
|
||||
const XMLCh* //systemId
|
||||
)
|
||||
{
|
||||
return createDocumentType(qName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-standard extension.
|
||||
*
|
||||
* Create a Notation.
|
||||
* @param name The name of the notation to instantiate
|
||||
* @return A <code>DOMNotation</code> that references the newly
|
||||
* created DOMNotation node.
|
||||
*/
|
||||
virtual DOMNotation *createNotation(const XMLCh *name) = 0;
|
||||
|
||||
/**
|
||||
* Non-standard extension.
|
||||
*
|
||||
* Creates an element of the given qualified name and
|
||||
* namespace URI, and also stores line/column number info.
|
||||
* Used by internally XSDXercesDOMParser during schema traversal.
|
||||
*
|
||||
* @see createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName)
|
||||
*/
|
||||
virtual DOMElement *createElementNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
const XMLFileLoc lineNum,
|
||||
const XMLFileLoc columnNum) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentFragment.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* DOMDocumentFragment is a "lightweight" or "minimal"
|
||||
* DOMDocument object.
|
||||
*
|
||||
* It is very common to want to be able to
|
||||
* extract a portion of a document's tree or to create a new fragment of a
|
||||
* document. Imagine implementing a user command like cut or rearranging a
|
||||
* document by moving fragments around. It is desirable to have an object
|
||||
* which can hold such fragments and it is quite natural to use a DOMNode for
|
||||
* this purpose. While it is true that a <code>DOMDocument</code> object could
|
||||
* fulfill this role, a <code>DOMDocument</code> object can potentially be a
|
||||
* heavyweight object, depending on the underlying implementation. What is
|
||||
* really needed for this is a very lightweight object.
|
||||
* <code>DOMDocumentFragment</code> is such an object.
|
||||
* <p>Furthermore, various operations -- such as inserting nodes as children
|
||||
* of another <code>DOMNode</code> -- may take <code>DOMDocumentFragment</code>
|
||||
* objects as arguments; this results in all the child nodes of the
|
||||
* <code>DOMDocumentFragment</code> being moved to the child list of this node.
|
||||
* <p>The children of a <code>DOMDocumentFragment</code> node are zero or more
|
||||
* nodes representing the tops of any sub-trees defining the structure of the
|
||||
* document. <code>DOMDocumentFragment</code> nodes do not need to be
|
||||
* well-formed XML documents (although they do need to follow the rules
|
||||
* imposed upon well-formed XML parsed entities, which can have multiple top
|
||||
* nodes). For example, a <code>DOMDocumentFragment</code> might have only one
|
||||
* child and that child node could be a <code>DOMText</code> node. Such a
|
||||
* structure model represents neither an HTML document nor a well-formed XML
|
||||
* document.
|
||||
* <p>When a <code>DOMDocumentFragment</code> is inserted into a
|
||||
* <code>DOMDocument</code> (or indeed any other <code>DOMNode</code> that may take
|
||||
* children) the children of the <code>DOMDocumentFragment</code> and not the
|
||||
* <code>DOMDocumentFragment</code> itself are inserted into the
|
||||
* <code>DOMNode</code>. This makes the <code>DOMDocumentFragment</code> very
|
||||
* useful when the user wishes to create nodes that are siblings; the
|
||||
* <code>DOMDocumentFragment</code> acts as the parent of these nodes so that the
|
||||
* user can use the standard methods from the <code>DOMNode</code> interface,
|
||||
* such as <code>insertBefore()</code> and <code>appendChild()</code>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMDocumentFragment: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMDocumentFragment() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMDocumentFragment(const DOMDocumentFragment &);
|
||||
DOMDocumentFragment & operator = (const DOMDocumentFragment &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMDocumentFragment() {};
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentRange.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTRANGE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTRANGE_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMRange;
|
||||
|
||||
|
||||
/**
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
class CDOM_EXPORT DOMDocumentRange {
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMDocumentRange() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMDocumentRange(const DOMDocumentRange &);
|
||||
DOMDocumentRange & operator = (const DOMDocumentRange &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMDocumentRange() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMDocumentRange interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
/**
|
||||
* To create the range consisting of boundary-points and offset of the
|
||||
* selected contents
|
||||
*
|
||||
* @return The initial state of the Range such that both the boundary-points
|
||||
* are positioned at the beginning of the corresponding DOMDOcument, before
|
||||
* any content. The range returned can only be used to select content
|
||||
* associated with this document, or with documentFragments and Attrs for
|
||||
* which this document is the ownerdocument
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMRange *createRange() = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentTraversal.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTRAVERSAL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTRAVERSAL_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
class DOMNodeIterator;
|
||||
class DOMTreeWalker;
|
||||
|
||||
|
||||
/**
|
||||
* <code>DOMDocumentTraversal</code> contains methods that create
|
||||
* <code>DOMNodeIterators</code> and <code>DOMTreeWalkers</code> to traverse a
|
||||
* node and its children in document order (depth first, pre-order
|
||||
* traversal, which is equivalent to the order in which the start tags occur
|
||||
* in the text representation of the document). In DOMs which support the
|
||||
* Traversal feature, <code>DOMDocumentTraversal</code> will be implemented by
|
||||
* the same objects that implement the DOMDocument interface.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
class CDOM_EXPORT DOMDocumentTraversal {
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMDocumentTraversal() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMDocumentTraversal(const DOMDocumentTraversal &);
|
||||
DOMDocumentTraversal & operator = (const DOMDocumentTraversal &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMDocumentTraversal() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMDocumentRange interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
/**
|
||||
* Creates a NodeIterator object. (DOM2)
|
||||
*
|
||||
* NodeIterators are used to step through a set of nodes, e.g. the set of nodes in a NodeList, the
|
||||
* document subtree governed by a particular node, the results of a query, or any other set of nodes.
|
||||
* The set of nodes to be iterated is determined by the implementation of the NodeIterator. DOM Level 2
|
||||
* specifies a single NodeIterator implementation for document-order traversal of a document subtree.
|
||||
* Instances of these iterators are created by calling <code>DOMDocumentTraversal.createNodeIterator()</code>.
|
||||
*
|
||||
* To produce a view of the document that has entity references expanded and does not
|
||||
* expose the entity reference node itself, use the <code>whatToShow</code> flags to hide the entity
|
||||
* reference node and set expandEntityReferences to true when creating the iterator. To
|
||||
* produce a view of the document that has entity reference nodes but no entity expansion,
|
||||
* use the <code>whatToShow</code> flags to show the entity reference node and set
|
||||
* expandEntityReferences to false.
|
||||
*
|
||||
* @param root The root node of the DOM tree
|
||||
* @param whatToShow This attribute determines which node types are presented via the iterator.
|
||||
* @param filter The filter used to screen nodes
|
||||
* @param entityReferenceExpansion The value of this flag determines whether the children of entity reference nodes are
|
||||
* visible to the iterator. If false, they will be skipped over.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
|
||||
virtual DOMNodeIterator *createNodeIterator(DOMNode* root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* filter,
|
||||
bool entityReferenceExpansion) = 0;
|
||||
/**
|
||||
* Creates a TreeWalker object. (DOM2)
|
||||
*
|
||||
* TreeWalker objects are used to navigate a document tree or subtree using the view of the document defined
|
||||
* by its whatToShow flags and any filters that are defined for the TreeWalker. Any function which performs
|
||||
* navigation using a TreeWalker will automatically support any view defined by a TreeWalker.
|
||||
*
|
||||
* Omitting nodes from the logical view of a subtree can result in a structure that is substantially different from
|
||||
* the same subtree in the complete, unfiltered document. Nodes that are siblings in the TreeWalker view may
|
||||
* be children of different, widely separated nodes in the original view. For instance, consider a Filter that skips
|
||||
* all nodes except for DOMText nodes and the root node of a document. In the logical view that results, all text
|
||||
* nodes will be siblings and appear as direct children of the root node, no matter how deeply nested the
|
||||
* structure of the original document.
|
||||
*
|
||||
* To produce a view of the document that has entity references expanded
|
||||
* and does not expose the entity reference node itself, use the whatToShow
|
||||
* flags to hide the entity reference node and set <code>expandEntityReferences</code> to
|
||||
* true when creating the TreeWalker. To produce a view of the document
|
||||
* that has entity reference nodes but no entity expansion, use the
|
||||
* <code>whatToShow</code> flags to show the entity reference node and set
|
||||
* <code>expandEntityReferences</code> to false
|
||||
*
|
||||
* @param root The root node of the DOM tree
|
||||
* @param whatToShow This attribute determines which node types are presented via the tree-walker.
|
||||
* @param filter The filter used to screen nodes
|
||||
* @param entityReferenceExpansion The value of this flag determines whether the children of entity reference nodes are
|
||||
* visible to the tree-walker. If false, they will be skipped over.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
|
||||
virtual DOMTreeWalker *createTreeWalker(DOMNode* root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* filter,
|
||||
bool entityReferenceExpansion) = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentType.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPE_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNamedNodeMap;
|
||||
|
||||
/**
|
||||
* Each <code>DOMDocument</code> has a <code>doctype</code> attribute whose value
|
||||
* is either <code>null</code> or a <code>DOMDocumentType</code> object. The
|
||||
* <code>DOMDocumentType</code> interface in the DOM Core provides an interface
|
||||
* to the list of entities that are defined for the document, and little
|
||||
* else because the effect of namespaces and the various XML schema efforts
|
||||
* on DTD representation are not clearly understood as of this writing.
|
||||
* <p>The DOM Level 2 doesn't support editing <code>DOMDocumentType</code> nodes.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMDocumentType: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMDocumentType() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMDocumentType(const DOMDocumentType &);
|
||||
DOMDocumentType & operator = (const DOMDocumentType &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMDocumentType() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMDocumentType interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
/**
|
||||
* The name of DTD; i.e., the name immediately following the
|
||||
* <code>DOCTYPE</code> keyword.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getName() const = 0;
|
||||
|
||||
/**
|
||||
* A <code>DOMNamedNodeMap</code> containing the general entities, both
|
||||
* external and internal, declared in the DTD. Parameter entities are
|
||||
* not contained. Duplicates are discarded. For example in:
|
||||
* <code><!DOCTYPE<br>
|
||||
* ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar<br>
|
||||
* "bar"> <!ENTITY bar "bar2"> <!ENTITY % baz "baz"><br>
|
||||
* ]> <ex/><br></code>
|
||||
* the interface provides access to <code>foo</code>
|
||||
* and the first declaration of <code>bar</code> but not the second
|
||||
* declaration of <code>bar</code> or <code>baz</code>. Every node in
|
||||
* this map also implements the <code>DOMEntity</code> interface.
|
||||
* <br>The DOM Level 2 does not support editing entities, therefore
|
||||
* <code>entities</code> cannot be altered in any way.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNamedNodeMap *getEntities() const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* A <code>DOMNamedNodeMap</code> containing the notations declared in the
|
||||
* DTD. Duplicates are discarded. Every node in this map also implements
|
||||
* the <code>DOMNotation</code> interface.
|
||||
* <br>The DOM Level 2 does not support editing notations, therefore
|
||||
* <code>notations</code> cannot be altered in any way.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNamedNodeMap *getNotations() const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2. */
|
||||
//@{
|
||||
/**
|
||||
* Get the public identifier of the external subset.
|
||||
*
|
||||
* @return The public identifier of the external subset.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getPublicId() const = 0;
|
||||
|
||||
/**
|
||||
* Get the system identifier of the external subset.
|
||||
*
|
||||
* @return The system identifier of the external subset.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getSystemId() const = 0;
|
||||
|
||||
/**
|
||||
* The internal subset as a string, or <code>null</code> if there is none.
|
||||
* This is does not contain the delimiting square brackets.The actual
|
||||
* content returned depends on how much information is available to the
|
||||
* implementation. This may vary depending on various parameters,
|
||||
* including the XML processor used to build the document.
|
||||
*
|
||||
* @return The internal subset as a string.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getInternalSubset() const = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,528 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMElement.hpp 792236 2009-07-08 17:22:35Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMELEMENT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMAttr;
|
||||
class DOMNodeList;
|
||||
class DOMTypeInfo;
|
||||
|
||||
|
||||
/**
|
||||
* By far the vast majority of objects (apart from text) that authors
|
||||
* encounter when traversing a document are <code>DOMElement</code> nodes.
|
||||
*
|
||||
* Assume the following XML document:<elementExample id="demo">
|
||||
* <subelement1/>
|
||||
* <subelement2><subsubelement/></subelement2>
|
||||
* </elementExample>
|
||||
* <p>When represented using DOM, the top node is an <code>DOMElement</code> node
|
||||
* for "elementExample", which contains two child <code>DOMElement</code> nodes,
|
||||
* one for "subelement1" and one for "subelement2". "subelement1" contains no
|
||||
* child nodes.
|
||||
* <p>Elements may have attributes associated with them; since the
|
||||
* <code>DOMElement</code> interface inherits from <code>DOMNode</code>, the generic
|
||||
* <code>DOMNode</code> interface method <code>getAttributes</code> may be used
|
||||
* to retrieve the set of all attributes for an element. There are methods on
|
||||
* the <code>DOMElement</code> interface to retrieve either an <code>DOMAttr</code>
|
||||
* object by name or an attribute value by name. In XML, where an attribute
|
||||
* value may contain entity references, an <code>DOMAttr</code> object should be
|
||||
* retrieved to examine the possibly fairly complex sub-tree representing the
|
||||
* attribute value. On the other hand, in HTML, where all attributes have
|
||||
* simple string values, methods to directly access an attribute value can
|
||||
* safely be used as a convenience.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*
|
||||
* It also defines the ElementTraversal helper interface defined by http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/
|
||||
*
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMElement: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMElement() {}
|
||||
DOMElement(const DOMElement &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMElement & operator = (const DOMElement &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMElement() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMElement interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The name of the element.
|
||||
*
|
||||
* For example, in: <elementExample
|
||||
* id="demo"> ... </elementExample> , <code>tagName</code> has
|
||||
* the value <code>"elementExample"</code>. Note that this is
|
||||
* case-preserving in XML, as are all of the operations of the DOM.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getTagName() const = 0;
|
||||
|
||||
/**
|
||||
* Retrieves an attribute value by name.
|
||||
*
|
||||
* @param name The name of the attribute to retrieve.
|
||||
* @return The <code>DOMAttr</code> value as a string, or the empty string if
|
||||
* that attribute does not have a specified or default value.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getAttribute(const XMLCh *name) const = 0;
|
||||
|
||||
/**
|
||||
* Retrieves an <code>DOMAttr</code> node by name.
|
||||
*
|
||||
* @param name The name (<CODE>nodeName</CODE>) of the attribute to retrieve.
|
||||
* @return The <code>DOMAttr</code> node with the specified name (<CODE>nodeName</CODE>) or
|
||||
* <code>null</code> if there is no such attribute.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMAttr * getAttributeNode(const XMLCh *name) const = 0;
|
||||
|
||||
/**
|
||||
* Returns a <code>DOMNodeList</code> of all descendant elements with a given
|
||||
* tag name, in the order in which they would be encountered in a preorder
|
||||
* traversal of the <code>DOMElement</code> tree.
|
||||
*
|
||||
* @param name The name of the tag to match on. The special value "*"
|
||||
* matches all tags.
|
||||
* @return A list of matching <code>DOMElement</code> nodes.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNodeList * getElementsByTagName(const XMLCh *name) const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Adds a new attribute.
|
||||
*
|
||||
* If an attribute with that name is already present
|
||||
* in the element, its value is changed to be that of the value parameter.
|
||||
* This value is a simple string, it is not parsed as it is being set. So
|
||||
* any markup (such as syntax to be recognized as an entity reference) is
|
||||
* treated as literal text, and needs to be appropriately escaped by the
|
||||
* implementation when it is written out. In order to assign an attribute
|
||||
* value that contains entity references, the user must create an
|
||||
* <code>DOMAttr</code> node plus any <code>DOMText</code> and
|
||||
* <code>DOMEntityReference</code> nodes, build the appropriate subtree, and
|
||||
* use <code>setAttributeNode</code> to assign it as the value of an
|
||||
* attribute.
|
||||
* @param name The name of the attribute to create or alter.
|
||||
* @param value Value to set in string form.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified name contains an
|
||||
* illegal character.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void setAttribute(const XMLCh *name,
|
||||
const XMLCh *value) = 0;
|
||||
/**
|
||||
* Adds a new attribute.
|
||||
*
|
||||
* If an attribute with that name (<CODE>nodeName</CODE>) is already present
|
||||
* in the element, it is replaced by the new one.
|
||||
* @param newAttr The <code>DOMAttr</code> node to add to the attribute list.
|
||||
* @return If the <code>newAttr</code> attribute replaces an existing
|
||||
* attribute, the replaced
|
||||
* <code>DOMAttr</code> node is returned, otherwise <code>null</code> is
|
||||
* returned.
|
||||
* @exception DOMException
|
||||
* WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
|
||||
* different document than the one that created the element.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
|
||||
* attribute of another <code>DOMElement</code> object. The DOM user must
|
||||
* explicitly clone <code>DOMAttr</code> nodes to re-use them in other
|
||||
* elements.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMAttr * setAttributeNode(DOMAttr *newAttr) = 0;
|
||||
|
||||
/**
|
||||
* Removes the specified attribute node.
|
||||
* If the removed <CODE>DOMAttr</CODE>
|
||||
* has a default value it is immediately replaced. The replacing attribute
|
||||
* has the same namespace URI and local name, as well as the original prefix,
|
||||
* when applicable.
|
||||
*
|
||||
* @param oldAttr The <code>DOMAttr</code> node to remove from the attribute
|
||||
* list.
|
||||
* @return The <code>DOMAttr</code> node that was removed.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute
|
||||
* of the element.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMAttr * removeAttributeNode(DOMAttr *oldAttr) = 0;
|
||||
|
||||
/**
|
||||
* Removes an attribute by name.
|
||||
*
|
||||
* If the removed attribute
|
||||
* is known to have a default value, an attribute immediately appears
|
||||
* containing the default value as well as the corresponding namespace URI,
|
||||
* local name, and prefix when applicable.<BR>To remove an attribute by local
|
||||
* name and namespace URI, use the <CODE>removeAttributeNS</CODE> method.
|
||||
* @param name The name of the attribute to remove.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void removeAttribute(const XMLCh *name) = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2. */
|
||||
//@{
|
||||
/**
|
||||
* Retrieves an attribute value by local name and namespace URI.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the attribute to retrieve.
|
||||
* @param localName The <em>local name</em> of the
|
||||
* attribute to retrieve.
|
||||
* @return The <code>DOMAttr</code> value as a string, or an <CODE>null</CODE> if
|
||||
* that attribute does not have a specified or default value.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
|
||||
/**
|
||||
* Adds a new attribute. If an attribute with the same
|
||||
* local name and namespace URI is already present on the element, its prefix
|
||||
* is changed to be the prefix part of the <CODE>qualifiedName</CODE>, and
|
||||
* its value is changed to be the <CODE>value</CODE> parameter. This value is
|
||||
* a simple string, it is not parsed as it is being set. So any markup (such
|
||||
* as syntax to be recognized as an entity reference) is treated as literal
|
||||
* text, and needs to be appropriately escaped by the implementation when it
|
||||
* is written out. In order to assign an attribute value that contains entity
|
||||
* references, the user must create an <CODE>DOMAttr</CODE>
|
||||
* node plus any <CODE>DOMText</CODE> and <CODE>DOMEntityReference</CODE>
|
||||
* nodes, build the appropriate subtree, and use
|
||||
* <CODE>setAttributeNodeNS</CODE> or <CODE>setAttributeNode</CODE> to assign
|
||||
* it as the value of an attribute.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the attribute to create or alter.
|
||||
* @param qualifiedName The <em>qualified name</em> of the
|
||||
* attribute to create or alter.
|
||||
* @param value The value to set in string form.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an
|
||||
* illegal character.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>
|
||||
* NAMESPACE_ERR: Raised if the <CODE>qualifiedName</CODE> is
|
||||
* malformed, if the <CODE>qualifiedName</CODE> has a prefix and the
|
||||
* <CODE>namespaceURI</CODE> is <CODE>null</CODE> or an empty string,
|
||||
* if the <CODE>qualifiedName</CODE> has a prefix that is "xml" and the
|
||||
* <CODE>namespaceURI</CODE> is different from
|
||||
* "http://www.w3.org/XML/1998/namespace", if the
|
||||
* <CODE>qualifiedName</CODE> has a prefix that is "xmlns" and the
|
||||
* <CODE>namespaceURI</CODE> is different from
|
||||
* "http://www.w3.org/2000/xmlns/", or if the
|
||||
* <CODE>qualifiedName</CODE> is "xmlns" and the
|
||||
* <CODE>namespaceURI</CODE> is different from
|
||||
* "http://www.w3.org/2000/xmlns/".
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName, const XMLCh *value) = 0;
|
||||
|
||||
/**
|
||||
* Removes an attribute by local name and namespace URI. If the
|
||||
* removed attribute has a default value it is immediately replaced.
|
||||
* The replacing attribute has the same namespace URI and local name, as well as
|
||||
* the original prefix.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the attribute to remove.
|
||||
* @param localName The <em>local name</em> of the
|
||||
* attribute to remove.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void removeAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) = 0;
|
||||
|
||||
/**
|
||||
* Retrieves an <code>DOMAttr</code> node by local name and namespace URI.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the attribute to retrieve.
|
||||
* @param localName The <em>local name</em> of the
|
||||
* attribute to retrieve.
|
||||
* @return The <code>DOMAttr</code> node with the specified attribute local
|
||||
* name and namespace URI or <code>null</code> if there is no such attribute.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMAttr * getAttributeNodeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
|
||||
/**
|
||||
* Adds a new attribute.
|
||||
*
|
||||
* If an attribute with that local name and namespace URI is already present
|
||||
* in the element, it is replaced by the new one.
|
||||
*
|
||||
* @param newAttr The <code>DOMAttr</code> node to add to the attribute list.
|
||||
* @return If the <code>newAttr</code> attribute replaces an existing
|
||||
* attribute with the same <em>local name</em> and <em>namespace URI</em>,
|
||||
* the replaced <code>DOMAttr</code> node is
|
||||
* returned, otherwise <code>null</code> is returned.
|
||||
* @exception DOMException
|
||||
* WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
|
||||
* different document than the one that created the element.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
|
||||
* attribute of another <code>DOMElement</code> object. The DOM user must
|
||||
* explicitly clone <code>DOMAttr</code> nodes to re-use them in other
|
||||
* elements.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMAttr * setAttributeNodeNS(DOMAttr *newAttr) = 0;
|
||||
|
||||
/**
|
||||
* Returns a <code>DOMNodeList</code> of all the <code>DOMElement</code>s
|
||||
* with a given local name and namespace URI in the order in which they
|
||||
* would be encountered in a preorder traversal of the
|
||||
* <code>DOMDocument</code> tree, starting from this node.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the elements to match on. The special value "*" matches all
|
||||
* namespaces.
|
||||
* @param localName The <em>local name</em> of the
|
||||
* elements to match on. The special value "*" matches all local names.
|
||||
* @return A new <code>DOMNodeList</code> object containing all the matched
|
||||
* <code>DOMElement</code>s.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNodeList * getElementsByTagNameNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> when an attribute with a given name is
|
||||
* specified on this element or has a default value, <code>false</code>
|
||||
* otherwise.
|
||||
* @param name The name of the attribute to look for.
|
||||
* @return <code>true</code> if an attribute with the given name is
|
||||
* specified on this element or has a default value, <code>false</code>
|
||||
* otherwise.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool hasAttribute(const XMLCh *name) const = 0;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> when an attribute with a given local name and
|
||||
* namespace URI is specified on this element or has a default value,
|
||||
* <code>false</code> otherwise. HTML-only DOM implementations do not
|
||||
* need to implement this method.
|
||||
* @param namespaceURI The namespace URI of the attribute to look for.
|
||||
* @param localName The local name of the attribute to look for.
|
||||
* @return <code>true</code> if an attribute with the given local name
|
||||
* and namespace URI is specified or has a default value on this
|
||||
* element, <code>false</code> otherwise.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool hasAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* If the parameter isId is <code>true</code>, this method declares the specified
|
||||
* attribute to be a user-determined ID attribute.
|
||||
* This affects the value of <code>DOMAttr::isId</code> and the behavior of
|
||||
* <code>DOMDocument::getElementById</code>, but does not change any schema that
|
||||
* may be in use, in particular this does not affect the <code>DOMAttr::getSchemaTypeInfo</code>
|
||||
* of the specified DOMAttr node. Use the value <code>false</code> for the parameter isId
|
||||
* to undeclare an attribute for being a user-determined ID attribute.
|
||||
* To specify an <code>DOMAttr</code> by local name and namespace URI, use the
|
||||
* setIdAttributeNS method.
|
||||
*
|
||||
* @param name The name of the <code>DOMAttr</code>.
|
||||
* @param isId Whether the attribute is of type ID.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.<br>
|
||||
* NOT_FOUND_ERR: Raised if the specified node is not an <code>DOMAttr</code>
|
||||
* of this element.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setIdAttribute(const XMLCh* name, bool isId) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* If the parameter isId is <code>true</code>, this method declares the specified
|
||||
* attribute to be a user-determined ID attribute.
|
||||
* This affects the value of <code>DOMAttr::isId</code> and the behavior of
|
||||
* <code>DOMDocument::getElementById</code>, but does not change any schema that
|
||||
* may be in use, in particular this does not affect the <code>DOMAttr::getSchemaTypeInfo</code>
|
||||
* of the specified DOMAttr node. Use the value <code>false</code> for the parameter isId
|
||||
* to undeclare an attribute for being a user-determined ID attribute.
|
||||
*
|
||||
* @param namespaceURI The namespace URI of the <code>DOMAttr</code>.
|
||||
* @param localName The local name of the <code>DOMAttr</code>.
|
||||
* @param isId Whether the attribute is of type ID.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.<br>
|
||||
* NOT_FOUND_ERR: Raised if the specified node is not an <code>DOMAttr</code> of this element.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId) = 0;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* If the parameter isId is <code>true</code>, this method declares the specified
|
||||
* attribute to be a user-determined ID attribute.
|
||||
* This affects the value of <code>DOMAttr::isId</code> and the behavior of
|
||||
* <code>DOMDocument::getElementById</code>, but does not change any schema that
|
||||
* may be in use, in particular this does not affect the <code>DOMAttr::getSchemaTypeInfo</code>
|
||||
* of the specified DOMAttr node. Use the value <code>false</code> for the parameter isId
|
||||
* to undeclare an attribute for being a user-determined ID attribute.
|
||||
*
|
||||
* @param idAttr The <code>DOMAttr</code> node.
|
||||
* @param isId Whether the attribute is of type ID.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.<br>
|
||||
* NOT_FOUND_ERR: Raised if the specified node is not an <code>DOMAttr</code> of this element.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId) = 0;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the type information associated with this element.
|
||||
*
|
||||
* @return the <code>DOMTypeInfo</code> associated with this element
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual const DOMTypeInfo* getSchemaTypeInfo() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DOMElementTraversal interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in the ElementTraversal specification (http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/)*/
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The first child of type DOMElement.
|
||||
*
|
||||
* @return The <code>DOMElement</code> object that is the first element node
|
||||
* among the child nodes of this node, or <code>null</code> if there is none.
|
||||
*/
|
||||
virtual DOMElement * getFirstElementChild() const = 0;
|
||||
|
||||
/**
|
||||
* The last child of type DOMElement.
|
||||
*
|
||||
* @return The <code>DOMElement</code> object that is the last element node
|
||||
* among the child nodes of this node, or <code>null</code> if there is none.
|
||||
*/
|
||||
virtual DOMElement * getLastElementChild() const = 0;
|
||||
|
||||
/**
|
||||
* The previous sibling node of type DOMElement.
|
||||
*
|
||||
* @return The <code>DOMElement</code> object that is the previous sibling element node
|
||||
* in document order, or <code>null</code> if there is none.
|
||||
*/
|
||||
virtual DOMElement * getPreviousElementSibling() const = 0;
|
||||
|
||||
/**
|
||||
* The next sibling node of type DOMElement.
|
||||
*
|
||||
* @return The <code>DOMElement</code> object that is the next sibling element node
|
||||
* in document order, or <code>null</code> if there is none.
|
||||
*/
|
||||
virtual DOMElement * getNextElementSibling() const = 0;
|
||||
|
||||
/**
|
||||
* The number of child nodes that are of type DOMElement.
|
||||
*
|
||||
* Note: the count is computed every time this function is invoked
|
||||
*
|
||||
* @return The number of <code>DOMElement</code> objects that are direct children
|
||||
* of this object (nested elements are not counted), or <code>0</code> if there is none.
|
||||
*
|
||||
*/
|
||||
virtual XMLSize_t getChildElementCount() const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMEntity.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITY_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMENTITY_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* This interface represents an entity, either parsed or unparsed, in an XML
|
||||
* document. Note that this models the entity itself not the entity
|
||||
* declaration. <code>DOMEntity</code> declaration modeling has been left for a
|
||||
* later Level of the DOM specification.
|
||||
* <p>The <code>nodeName</code> attribute that is inherited from
|
||||
* <code>DOMNode</code> contains the name of the entity.
|
||||
* <p>An XML processor may choose to completely expand entities before the
|
||||
* structure model is passed to the DOM; in this case there will be no
|
||||
* <code>DOMEntityReference</code> nodes in the document tree.
|
||||
* <p>XML does not mandate that a non-validating XML processor read and
|
||||
* process entity declarations made in the external subset or declared in
|
||||
* external parameter entities. This means that parsed entities declared in
|
||||
* the external subset need not be expanded by some classes of applications,
|
||||
* and that the replacement value of the entity may not be available. When
|
||||
* the replacement value is available, the corresponding <code>DOMEntity</code>
|
||||
* node's child list represents the structure of that replacement text.
|
||||
* Otherwise, the child list is empty.
|
||||
* <p>The DOM Level 2 does not support editing <code>DOMEntity</code> nodes; if a
|
||||
* user wants to make changes to the contents of an <code>DOMEntity</code>,
|
||||
* every related <code>DOMEntityReference</code> node has to be replaced in the
|
||||
* structure model by a clone of the <code>DOMEntity</code>'s contents, and
|
||||
* then the desired changes must be made to each of those clones instead.
|
||||
* <code>DOMEntity</code> nodes and all their descendants are readonly.
|
||||
* <p>An <code>DOMEntity</code> node does not have any parent.If the entity
|
||||
* contains an unbound namespace prefix, the <code>namespaceURI</code> of
|
||||
* the corresponding node in the <code>DOMEntity</code> node subtree is
|
||||
* <code>null</code>. The same is true for <code>DOMEntityReference</code>
|
||||
* nodes that refer to this entity, when they are created using the
|
||||
* <code>createEntityReference</code> method of the <code>DOMDocument</code>
|
||||
* interface. The DOM Level 2 does not support any mechanism to resolve
|
||||
* namespace prefixes.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMEntity: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMEntity() {}
|
||||
DOMEntity(const DOMEntity &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMEntity & operator = (const DOMEntity &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMEntity() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMEntity interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The public identifier associated with the entity, if specified.
|
||||
*
|
||||
* If the public identifier was not specified, this is <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getPublicId() const = 0;
|
||||
|
||||
/**
|
||||
* The system identifier associated with the entity, if specified.
|
||||
*
|
||||
* If the system identifier was not specified, this is <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getSystemId() const = 0;
|
||||
|
||||
/**
|
||||
* For unparsed entities, the name of the notation for the entity.
|
||||
*
|
||||
* For parsed entities, this is <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getNotationName() const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3. */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* An attribute specifying the encoding used for this entity at the time of parsing,
|
||||
* when it is an external parsed entity. This is <code>null</code> if it an entity
|
||||
* from the internal subset or if it is not known.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getInputEncoding() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the text declaration, the encoding
|
||||
* of this entity, when it is an external parsed entity. This is
|
||||
* <code>null</code> otherwise.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getXmlEncoding() const = 0;
|
||||
|
||||
/**
|
||||
* An attribute specifying, as part of the text declaration, the version
|
||||
* number of this entity, when it is an external parsed entity. This is
|
||||
* <code>null</code> otherwise.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getXmlVersion() const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMEntityReference.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCE_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* <code>DOMEntityReference</code> objects may be inserted into the structure
|
||||
* model when an entity reference is in the source document, or when the
|
||||
* user wishes to insert an entity reference. Note that character references
|
||||
* and references to predefined entities are considered to be expanded by
|
||||
* the HTML or XML processor so that characters are represented by their
|
||||
* Unicode equivalent rather than by an entity reference. Moreover, the XML
|
||||
* processor may completely expand references to entities while building the
|
||||
* structure model, instead of providing <code>DOMEntityReference</code>
|
||||
* objects. If it does provide such objects, then for a given
|
||||
* <code>DOMEntityReference</code> node, it may be that there is no
|
||||
* <code>DOMEntity</code> node representing the referenced entity. If such an
|
||||
* <code>DOMEntity</code> exists, then the subtree of the
|
||||
* <code>DOMEntityReference</code> node is in general a copy of the
|
||||
* <code>DOMEntity</code> node subtree. However, this may not be true when an
|
||||
* entity contains an unbound namespace prefix. In such a case, because the
|
||||
* namespace prefix resolution depends on where the entity reference is, the
|
||||
* descendants of the <code>DOMEntityReference</code> node may be bound to
|
||||
* different namespace URIs.
|
||||
* <p>As for <code>DOMEntity</code> nodes, <code>DOMEntityReference</code> nodes and
|
||||
* all their descendants are readonly.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMEntityReference: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMEntityReference() {}
|
||||
DOMEntityReference(const DOMEntityReference &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMEntityReference & operator = (const DOMEntityReference &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMEntityReference() {};
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMError.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMERROR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMERROR_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMLocator;
|
||||
|
||||
|
||||
/**
|
||||
* DOMError is an interface that describes an error.
|
||||
*
|
||||
* @see DOMErrorHandler#handleError
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMError
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMError() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMError(const DOMError &);
|
||||
DOMError & operator = (const DOMError &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMError() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public constants */
|
||||
//@{
|
||||
/**
|
||||
* The severity of the error described by the <code>DOMError</code>.
|
||||
*
|
||||
* <p><code>DOM_SEVERITY_ERROR:</code>
|
||||
* The severity of the error described by the <code>DOMError</code> is error.
|
||||
* A DOM_SEVERITY_ERROR may not cause the processing to stop if the error can
|
||||
* be recovered, unless <code>DOMErrorHandler::handleError()</code> returns false.</p>
|
||||
*
|
||||
* <p><code>DOM_SEVERITY_FATAL_ERROR</code>
|
||||
* The severity of the error described by the <code>DOMError</code> is fatal error.
|
||||
* A DOM_SEVERITY_FATAL_ERROR will cause the normal processing to stop. The return
|
||||
* value of <code>DOMErrorHandler::handleError()</code> is ignored unless the
|
||||
* implementation chooses to continue, in which case the behavior becomes undefined.</p>
|
||||
*
|
||||
* <p><code>DOM_SEVERITY_WARNING</code>
|
||||
* The severity of the error described by the <code>DOMError</code> is warning.
|
||||
* A DOM_SEVERITY_WARNING will not cause the processing to stop, unless
|
||||
* <code>DOMErrorHandler::handleError()</code> returns false.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum ErrorSeverity
|
||||
{
|
||||
DOM_SEVERITY_WARNING = 1,
|
||||
DOM_SEVERITY_ERROR = 2,
|
||||
DOM_SEVERITY_FATAL_ERROR = 3
|
||||
};
|
||||
//@}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMError interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Get the severity of the error
|
||||
*
|
||||
* @see setSeverity
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual ErrorSeverity getSeverity() const = 0;
|
||||
|
||||
/**
|
||||
* Get the message describing the error that occured.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getMessage() const = 0;
|
||||
|
||||
/**
|
||||
* Get the location of the error
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLocator* getLocation() const = 0;
|
||||
|
||||
/**
|
||||
* The related platform dependent exception if any.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* getRelatedException() const = 0;
|
||||
|
||||
/**
|
||||
* A <code>XMLCh*</code> indicating which related data is expected in
|
||||
* relatedData. Users should refer to the specification of the error
|
||||
* in order to find its <code>XMLCh*</code> type and relatedData
|
||||
* definitions if any.
|
||||
*
|
||||
* Note: As an example, <code>DOMDocument::normalizeDocument()</code> does generate
|
||||
* warnings when the "split-cdata-sections" parameter is in use. Therefore, the
|
||||
* method generates a DOM_SEVERITY_WARNING with type "cdata-sections-splitted"
|
||||
* and the first <code>DOMCDATASection</code> node in document order resulting from the split
|
||||
* is returned by the relatedData attribute.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getType() const = 0;
|
||||
|
||||
/**
|
||||
* The related DOMError::getType dependent data if any.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* getRelatedData() const = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMErrorHandler.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMERRORHANDLER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMERRORHANDLER_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMError;
|
||||
|
||||
/**
|
||||
* Basic interface for DOM error handlers.
|
||||
*
|
||||
* <p>DOMErrorHandler is a callback interface that the DOM implementation
|
||||
* can call when reporting errors that happens while processing XML data, or
|
||||
* when doing some other processing (e.g. validating a document).</p>
|
||||
*
|
||||
* <p>The application that is using the DOM implementation is expected to
|
||||
* implement this interface.</p>
|
||||
*
|
||||
* @see DOMLSParser#getDomConfig
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMErrorHandler
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMErrorHandler() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMErrorHandler(const DOMErrorHandler &);
|
||||
DOMErrorHandler & operator = (const DOMErrorHandler &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMErrorHandler() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMErrorHandler interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* This method is called on the error handler when an error occurs.
|
||||
* If an exception is thrown from this method, it is considered to be equivalent of returning <code>true</code>.
|
||||
*
|
||||
* @param domError The error object that describes the error, this object
|
||||
* may be reused by the DOM implementation across multiple
|
||||
* calls to the handleError method.
|
||||
* @return If the handleError method returns <code>true</code> the DOM
|
||||
* implementation should continue as if the error didn't happen
|
||||
* when possible, if the method returns <code>false</code> then the
|
||||
* DOM implementation should stop the current processing when
|
||||
* possible.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool handleError(const DOMError& domError) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMException.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMEXCEPTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMEXCEPTION_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
|
||||
* when an operation is impossible to perform (either for logical reasons,
|
||||
* because data is lost, or because the implementation has become unstable).
|
||||
* In general, DOM methods return specific error values in ordinary
|
||||
* processing situations, such as out-of-bound errors when using
|
||||
* <code>DOMNodeList</code>.
|
||||
* <p>Implementations should raise other exceptions under other circumstances.
|
||||
* For example, implementations should raise an implementation-dependent
|
||||
* exception if a <code>null</code> argument is passed.
|
||||
* <p>Some languages and object systems do not support the concept of
|
||||
* exceptions. For such systems, error conditions may be indicated using
|
||||
* native error reporting mechanisms. For some bindings, for example,
|
||||
* methods may return error codes similar to those listed in the
|
||||
* corresponding method descriptions.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
|
||||
class MemoryManager;
|
||||
|
||||
class CDOM_EXPORT DOMException {
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* ExceptionCode
|
||||
*
|
||||
* <p><code>INDEX_SIZE_ERR:</code>
|
||||
* If index or size is negative, or greater than the allowed value.</p>
|
||||
*
|
||||
* <p><code>DOMSTRING_SIZE_ERR:</code>
|
||||
* If the specified range of text does not fit into a DOMString.</p>
|
||||
*
|
||||
* <p><code>HIERARCHY_REQUEST_ERR:</code>
|
||||
* If any node is inserted somewhere it doesn't belong.</p>
|
||||
*
|
||||
* <p><code>WRONG_DOCUMENT_ERR:</code>
|
||||
* If a node is used in a different document than the one that created it
|
||||
* (that doesn't support it).</p>
|
||||
*
|
||||
* <p><code>INVALID_CHARACTER_ERR:</code>
|
||||
* If an invalid or illegal character is specified, such as in a name. See
|
||||
* production 2 in the XML specification for the definition of a legal
|
||||
* character, and production 5 for the definition of a legal name
|
||||
* character.</p>
|
||||
*
|
||||
* <p><code>NO_DATA_ALLOWED_ERR:</code>
|
||||
* If data is specified for a node which does not support data.</p>
|
||||
*
|
||||
* <p><code>NO_MODIFICATION_ALLOWED_ERR:</code>
|
||||
* If an attempt is made to modify an object where modifications are not
|
||||
* allowed.</p>
|
||||
*
|
||||
* <p><code>NOT_FOUND_ERR:</code>
|
||||
* If an attempt is made to reference a node in a context where it does
|
||||
* not exist.</p>
|
||||
*
|
||||
* <p><code>NOT_SUPPORTED_ERR:</code>
|
||||
* If the implementation does not support the requested type of object or
|
||||
* operation.</p>
|
||||
*
|
||||
* <p><code>INUSE_ATTRIBUTE_ERR:</code>
|
||||
* If an attempt is made to add an attribute that is already in use
|
||||
* elsewhere.</p>
|
||||
*
|
||||
* The above are since DOM Level 1
|
||||
* @since DOM Level 1
|
||||
*
|
||||
* <p><code>INVALID_STATE_ERR:</code>
|
||||
* If an attempt is made to use an object that is not, or is no longer,
|
||||
* usable.</p>
|
||||
*
|
||||
* <p><code>SYNTAX_ERR:</code>
|
||||
* If an invalid or illegal string is specified.</p>
|
||||
*
|
||||
* <p><code>INVALID_MODIFICATION_ERR:</code>
|
||||
* If an attempt is made to modify the type of the underlying object.</p>
|
||||
*
|
||||
* <p><code>NAMESPACE_ERR:</code>
|
||||
* If an attempt is made to create or change an object in a way which is
|
||||
* incorrect with regard to namespaces.</p>
|
||||
*
|
||||
* <p><code>INVALID_ACCESS_ERR:</code>
|
||||
* If a parameter or an operation is not supported by the underlying
|
||||
* object.
|
||||
*
|
||||
* The above are since DOM Level 2
|
||||
* @since DOM Level 2
|
||||
*
|
||||
* <p><code>VALIDATION_ERR:</code>
|
||||
* If a call to a method such as <code>insertBefore</code> or
|
||||
* <code>removeChild</code> would make the <code>Node</code> invalid
|
||||
* with respect to "partial validity", this exception would be raised
|
||||
* and the operation would not be done.
|
||||
*
|
||||
* <p><code>TYPE_MISMATCH_ERR:</code>
|
||||
* If the type of an object is incompatible with the expected type of
|
||||
* the parameter associated to the object, this exception would be raised.
|
||||
*
|
||||
* The above is since DOM Level 3
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum ExceptionCode {
|
||||
INDEX_SIZE_ERR = 1,
|
||||
DOMSTRING_SIZE_ERR = 2,
|
||||
HIERARCHY_REQUEST_ERR = 3,
|
||||
WRONG_DOCUMENT_ERR = 4,
|
||||
INVALID_CHARACTER_ERR = 5,
|
||||
NO_DATA_ALLOWED_ERR = 6,
|
||||
NO_MODIFICATION_ALLOWED_ERR = 7,
|
||||
NOT_FOUND_ERR = 8,
|
||||
NOT_SUPPORTED_ERR = 9,
|
||||
INUSE_ATTRIBUTE_ERR = 10,
|
||||
INVALID_STATE_ERR = 11,
|
||||
SYNTAX_ERR = 12,
|
||||
INVALID_MODIFICATION_ERR = 13,
|
||||
NAMESPACE_ERR = 14,
|
||||
INVALID_ACCESS_ERR = 15,
|
||||
VALIDATION_ERR = 16,
|
||||
TYPE_MISMATCH_ERR = 17
|
||||
};
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Constructors */
|
||||
//@{
|
||||
/**
|
||||
* Default constructor for DOMException.
|
||||
*
|
||||
*/
|
||||
DOMException();
|
||||
|
||||
/**
|
||||
* Constructor which takes an error code and an optional message code.
|
||||
*
|
||||
* @param code The error code which indicates the exception
|
||||
* @param messageCode The string containing the error message
|
||||
* @param memoryManager The memory manager used to (de)allocate memory
|
||||
*/
|
||||
DOMException(short code,
|
||||
short messageCode = 0,
|
||||
MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*
|
||||
* @param other The object to be copied.
|
||||
*/
|
||||
DOMException(const DOMException &other);
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Destructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor. */
|
||||
//@{
|
||||
/**
|
||||
* Destructor for DOMException.
|
||||
*
|
||||
*/
|
||||
virtual ~DOMException();
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter
|
||||
// -----------------------------------------------------------------------
|
||||
inline const XMLCh* getMessage() const;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public variables */
|
||||
//@{
|
||||
/**
|
||||
* A code value, from the set defined by the ExceptionCode enum,
|
||||
* indicating the type of error that occured.
|
||||
*/
|
||||
short code;
|
||||
|
||||
/**
|
||||
* A string value. Applications may use this field to hold an error
|
||||
* message. The field value is not set by the DOM implementation,
|
||||
* meaning that the string will be empty when an exception is first
|
||||
* thrown.
|
||||
*/
|
||||
const XMLCh *msg;
|
||||
//@}
|
||||
|
||||
protected:
|
||||
MemoryManager* fMemoryManager;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* A boolean value.
|
||||
* If the message is provided by the applications, it is not
|
||||
* adopted.
|
||||
* If the message is resolved by the DOM implementation, it is
|
||||
* owned.
|
||||
*/
|
||||
bool fMsgOwned;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMException & operator = (const DOMException &);
|
||||
};
|
||||
|
||||
inline const XMLCh* DOMException::getMessage() const
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementation.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP
|
||||
|
||||
#include <xercesc/dom/DOMImplementationLS.hpp>
|
||||
#include <xercesc/dom/DOMException.hpp>
|
||||
#include <xercesc/dom/DOMLSException.hpp>
|
||||
#include <xercesc/dom/DOMRangeException.hpp>
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMDocument;
|
||||
class DOMDocumentType;
|
||||
|
||||
/**
|
||||
* The <code>DOMImplementation</code> interface provides a number of methods
|
||||
* for performing operations that are independent of any particular instance
|
||||
* of the document object model.
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMImplementation : public DOMImplementationLS
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMImplementation() {}; // no plain constructor
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMImplementation(const DOMImplementation &); // no copy constructor.
|
||||
DOMImplementation & operator = (const DOMImplementation &); // No Assignment
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMImplementation() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMImplementation interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
/**
|
||||
* Test if the DOM implementation implements a specific feature.
|
||||
* @param feature The name of the feature to test (case-insensitive). The
|
||||
* values used by DOM features are defined throughout the DOM Level 2
|
||||
* specifications and listed in the section. The name must be an XML
|
||||
* name. To avoid possible conflicts, as a convention, names referring
|
||||
* to features defined outside the DOM specification should be made
|
||||
* unique.
|
||||
* @param version This is the version number of the feature to test. In
|
||||
* Level 2, the string can be either "2.0" or "1.0". If the version is
|
||||
* not specified, supporting any version of the feature causes the
|
||||
* method to return <code>true</code>.
|
||||
* @return <code>true</code> if the feature is implemented in the
|
||||
* specified version, <code>false</code> otherwise.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual bool hasFeature(const XMLCh *feature, const XMLCh *version) const = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Functions introduced in DOM Level 2
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
/**
|
||||
* Creates an empty <code>DOMDocumentType</code> node. Entity declarations
|
||||
* and notations are not made available. Entity reference expansions and
|
||||
* default attribute additions do not occur. It is expected that a
|
||||
* future version of the DOM will provide a way for populating a
|
||||
* <code>DOMDocumentType</code>.
|
||||
* @param qualifiedName The qualified name of the document type to be
|
||||
* created.
|
||||
* @param publicId The external subset public identifier.
|
||||
* @param systemId The external subset system identifier.
|
||||
* @return A new <code>DOMDocumentType</code> node with
|
||||
* <code>ownerDocument</code> set to <code>null</code>.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
||||
* contains an illegal character.
|
||||
* <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
|
||||
* malformed.
|
||||
* <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
|
||||
* not support the <code>"XML"</code> feature, if they choose not to
|
||||
* support this method. Other features introduced in the future, by
|
||||
* the DOM WG or in extensions defined by other groups, may also
|
||||
* demand support for this method; please consult the definition of
|
||||
* the feature to see if it requires this method.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMDocumentType *createDocumentType(const XMLCh *qualifiedName,
|
||||
const XMLCh *publicId,
|
||||
const XMLCh *systemId) = 0;
|
||||
|
||||
/**
|
||||
* Creates a DOMDocument object of the specified type with its document
|
||||
* element.
|
||||
* @param namespaceURI The namespace URI of the document element to
|
||||
* create.
|
||||
* @param qualifiedName The qualified name of the document element to be
|
||||
* created.
|
||||
* @param doctype The type of document to be created or <code>null</code>.
|
||||
* When <code>doctype</code> is not <code>null</code>, its
|
||||
* <code>ownerDocument</code> attribute is set to the document
|
||||
* being created.
|
||||
* @param manager Pointer to the memory manager to be used to
|
||||
* allocate objects.
|
||||
* @return A new <code>DOMDocument</code> object.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
||||
* contains an illegal character.
|
||||
* <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
|
||||
* malformed, if the <code>qualifiedName</code> has a prefix and the
|
||||
* <code>namespaceURI</code> is <code>null</code>, or if the
|
||||
* <code>qualifiedName</code> has a prefix that is "xml" and the
|
||||
* <code>namespaceURI</code> is different from "
|
||||
* http://www.w3.org/XML/1998/namespace" , or if the DOM
|
||||
* implementation does not support the <code>"XML"</code> feature but
|
||||
* a non-null namespace URI was provided, since namespaces were
|
||||
* defined by XML.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
|
||||
* been used with a different document or was created from a different
|
||||
* implementation.
|
||||
* <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
|
||||
* not support the "XML" feature, if they choose not to support this
|
||||
* method. Other features introduced in the future, by the DOM WG or
|
||||
* in extensions defined by other groups, may also demand support for
|
||||
* this method; please consult the definition of the feature to see if
|
||||
* it requires this method.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
|
||||
virtual DOMDocument *createDocument(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
DOMDocumentType *doctype,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
|
||||
|
||||
//@}
|
||||
// -----------------------------------------------------------------------
|
||||
// Functions introduced in DOM Level 3
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* This method returns a specialized object which implements the specialized APIs
|
||||
* of the specified feature and version, as specified in DOM Features.
|
||||
* This method also allow the implementation to provide specialized objects which
|
||||
* do not support the <code>DOMImplementation</code> interface.
|
||||
*
|
||||
* @param feature The name of the feature requested (case-insensitive).
|
||||
* Note that any plus sign "+" prepended to the name of the feature will
|
||||
* be ignored since it is not significant in the context of this method.
|
||||
* @param version This is the version number of the feature to test.
|
||||
* @return Returns an object which implements the specialized APIs of the specified
|
||||
* feature and version, if any, or null if there is no object which implements
|
||||
* interfaces associated with that feature.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard extension */
|
||||
//@{
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Create a completely empty document that has neither a root element or a doctype node.
|
||||
*/
|
||||
virtual DOMDocument *createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
|
||||
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Factory method for getting a DOMImplementation object.
|
||||
* The DOM implementation retains ownership of the returned object.
|
||||
* Application code should NOT delete it.
|
||||
*/
|
||||
static DOMImplementation *getImplementation();
|
||||
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Load the default error text message for DOMException.
|
||||
* @param msgToLoad The DOM ExceptionCode id to be processed
|
||||
* @param toFill The buffer that will hold the output on return. The
|
||||
* size of this buffer should at least be 'maxChars + 1'.
|
||||
* @param maxChars The maximum number of output characters that can be
|
||||
* accepted. If the result will not fit, it is an error.
|
||||
* @return <code>true</code> if the message is successfully loaded
|
||||
*/
|
||||
static bool loadDOMExceptionMsg
|
||||
(
|
||||
const short msgToLoad
|
||||
, XMLCh* const toFill
|
||||
, const XMLSize_t maxChars
|
||||
);
|
||||
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationLS.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLS_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLS_HPP
|
||||
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMLSParser;
|
||||
class DOMLSSerializer;
|
||||
class DOMLSInput;
|
||||
class DOMLSOutput;
|
||||
class MemoryManager;
|
||||
class XMLGrammarPool;
|
||||
|
||||
/**
|
||||
* <p><code>DOMImplementationLS</code> contains the factory methods for
|
||||
* creating Load and Save objects.</p>
|
||||
*
|
||||
* <p>An object that implements DOMImplementationLS is obtained by doing a
|
||||
* binding specific cast from DOMImplementation to DOMImplementationLS.
|
||||
* Implementations supporting the Load and Save feature must implement the
|
||||
* DOMImplementationLS interface on whatever object implements the
|
||||
* DOMImplementation interface.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMImplementationLS
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMImplementationLS() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMImplementationLS(const DOMImplementationLS &);
|
||||
DOMImplementationLS & operator = (const DOMImplementationLS &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMImplementationLS() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Public constants
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public constants */
|
||||
//@{
|
||||
/**
|
||||
* Create a synchronous or an asynchronous <code>DOMLSParser</code>.
|
||||
* @see createLSParser(const DOMImplementationLSMode mode, const XMLCh* const schemaType)
|
||||
* @since DOM Level 3
|
||||
*
|
||||
*/
|
||||
enum DOMImplementationLSMode
|
||||
{
|
||||
MODE_SYNCHRONOUS = 1,
|
||||
MODE_ASYNCHRONOUS = 2
|
||||
};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMImplementationLS interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Factory create methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Create a new DOMLSParser. The newly constructed parser may then be configured
|
||||
* by means of its DOMConfiguration object, and used to parse documents by
|
||||
* means of its parse method.
|
||||
*
|
||||
* @param mode The mode argument is either <code>MODE_SYNCHRONOUS</code>
|
||||
* or <code>MODE_ASYNCHRONOUS</code>, if mode is <code>MODE_SYNCHRONOUS</code>
|
||||
* then the <code>DOMLSParser</code> that is created will operate in synchronous
|
||||
* mode, if it's <code>MODE_ASYNCHRONOUS</code> then the <code>DOMLSParser</code>
|
||||
* that is created will operate in asynchronous mode.
|
||||
* @param schemaType An absolute URI representing the type of the schema
|
||||
* language used during the load of a <code>DOMDocument</code> using the newly
|
||||
* created <code>DOMLSParser</code>. Note that no lexical checking is done on
|
||||
* the absolute URI. In order to create a <code>DOMLSParser</code> for any kind
|
||||
* of schema types (i.e. the <code>DOMLSParser</code> will be free to use any
|
||||
* schema found), use the value <code>NULL</code>.
|
||||
* <b>Note</b>: For W3C XML Schema [XML Schema Part 1], applications must use
|
||||
* the value "http://www.w3.org/2001/XMLSchema". For XML DTD [XML 1.0],
|
||||
* applications must use the value "http://www.w3.org/TR/REC-xml".
|
||||
* Other Schema languages are outside the scope of the W3C and therefore should
|
||||
* recommend an absolute URI in order to use this method.
|
||||
* @param manager Pointer to the memory manager to be used to allocate objects.
|
||||
* @param gramPool The collection of cached grammars.
|
||||
* @return The newly created <code>DOMLSParser</code> object. This
|
||||
* <code>DOMLSParser</code> is either synchronous or asynchronous depending
|
||||
* on the value of the <code>mode</code> argument.
|
||||
* @exception DOMException NOT_SUPPORTED_ERR: Raised if the requested mode
|
||||
* or schema type is not supported.
|
||||
*
|
||||
* @see DOMLSParser
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSParser* createLSParser(const DOMImplementationLSMode mode,
|
||||
const XMLCh* const schemaType,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager,
|
||||
XMLGrammarPool* const gramPool = 0) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new DOMLSSerializer. DOMLSSerializer is used to serialize a DOM tree
|
||||
* back into an XML document.
|
||||
*
|
||||
* @return The newly created <code>DOMLSSerializer</code> object.
|
||||
*
|
||||
* @see DOMLSSerializer
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
|
||||
|
||||
/**
|
||||
* Create a new "empty" DOMLSInput.
|
||||
*
|
||||
* @return The newly created <code>DOMLSInput</code> object.
|
||||
*
|
||||
* @see DOMLSInput
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
|
||||
|
||||
/**
|
||||
* Create a new "empty" LSOutput.
|
||||
*
|
||||
* @return The newly created <code>LSOutput</code> object.
|
||||
*
|
||||
* @see LSOutput
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,124 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationList.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLIST_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLIST_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMImplementation;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMImplementationList</code> interface provides the abstraction of an ordered
|
||||
* collection of DOM implementations, without defining or constraining how this collection
|
||||
* is implemented. The items in the <code>DOMImplementationList</code> are accessible via
|
||||
* an integral index, starting from 0.
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMImplementationList {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMImplementationList() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMImplementationList(const DOMImplementationList &);
|
||||
DOMImplementationList & operator = (const DOMImplementationList &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMImplementationList() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMImplementationList interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the <code>index</code> item in the collection.
|
||||
*
|
||||
* If <code>index</code> is greater than or equal to the number of DOMImplementation in
|
||||
* the list, this returns <code>null</code>.
|
||||
*
|
||||
* @param index Index into the collection.
|
||||
* @return The DOMImplementation at the <code>index</code>th position in the
|
||||
* <code>DOMImplementationList</code>, or <code>null</code> if that is not a valid
|
||||
* index.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMImplementation *item(XMLSize_t index) const = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of DOMImplementation in the list.
|
||||
*
|
||||
* The range of valid child node indices is 0 to <code>length-1</code> inclusive.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLSize_t getLength() const = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this list is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it and
|
||||
* its associated children.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationRegistry.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONREGISTRY_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONREGISTRY_HPP
|
||||
|
||||
/**
|
||||
* This class holds the list of registered DOMImplementations. Implementation
|
||||
* or application can register DOMImplementationSource to the registry, and
|
||||
* then can query DOMImplementation based on a list of requested features.
|
||||
*
|
||||
* <p>This provides an application with an implementation independent starting
|
||||
* point.
|
||||
*
|
||||
* @see DOMImplementation
|
||||
* @see DOMImplementationList
|
||||
* @see DOMImplementationSource
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMImplementation;
|
||||
class DOMImplementationSource;
|
||||
class DOMImplementationList;
|
||||
|
||||
class CDOM_EXPORT DOMImplementationRegistry
|
||||
{
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Static DOMImplementationRegistry interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* Return the first registered implementation that has the desired features,
|
||||
* or null if none is found.
|
||||
*
|
||||
* @param features A string that specifies which features are required.
|
||||
* This is a space separated list in which each feature is
|
||||
* specified by its name optionally followed by a space
|
||||
* and a version number.
|
||||
* This is something like: "XML 1.0 Traversal 2.0"
|
||||
* @return An implementation that has the desired features, or
|
||||
* <code>null</code> if this source has none.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
static DOMImplementation* getDOMImplementation(const XMLCh* features);
|
||||
|
||||
/**
|
||||
* Return the list of registered implementation that have the desired features.
|
||||
*
|
||||
* @param features A string that specifies which features are required.
|
||||
* This is a space separated list in which each feature is
|
||||
* specified by its name optionally followed by a space
|
||||
* and a version number.
|
||||
* This is something like: "XML 1.0 Traversal 2.0"
|
||||
* @return A DOMImplementationList object that contains the DOMImplementation
|
||||
* that have the desired features
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
static DOMImplementationList* getDOMImplementationList(const XMLCh* features);
|
||||
|
||||
/**
|
||||
* Register an implementation.
|
||||
*
|
||||
* @param source A DOMImplementation Source object to be added to the registry.
|
||||
* The registry does NOT adopt the source object. Users still own it.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
static void addSource(DOMImplementationSource* source);
|
||||
//@}
|
||||
|
||||
private:
|
||||
DOMImplementationRegistry();
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationSource.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONSOURCE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONSOURCE_HPP
|
||||
|
||||
/**
|
||||
* This interface permits a DOM implementer to supply one or more
|
||||
* implementations, based upon requested features and versions. Each implemented
|
||||
* <code>DOMImplementationSource</code> object is listed in the
|
||||
* binding-specific list of available sources so that its
|
||||
* <code>DOMImplementation</code> objects are made available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMImplementation;
|
||||
class DOMImplementationList;
|
||||
|
||||
class CDOM_EXPORT DOMImplementationSource
|
||||
{
|
||||
protected :
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMImplementationSource() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMImplementationSource(const DOMImplementationSource &);
|
||||
DOMImplementationSource & operator = (const DOMImplementationSource &);
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMImplementationSource() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMImplementationSource interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* A method to request the first DOM implementation that supports the specified features.
|
||||
*
|
||||
* @param features A string that specifies which features are required.
|
||||
* This is a space separated list in which each feature is specified
|
||||
* by its name optionally followed by a space and a version number.
|
||||
* This is something like: "XML 1.0 Traversal 2.0"
|
||||
* @return An implementation that has the desired features, or
|
||||
* <code>null</code> if this source has none.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const = 0;
|
||||
|
||||
/**
|
||||
* A method to request a list of DOM implementations that support the specified features and versions,
|
||||
*
|
||||
* @param features A string that specifies which features are required.
|
||||
* This is a space separated list in which each feature is specified
|
||||
* by its name optionally followed by a space and a version number.
|
||||
* This is something like: "XML 1.0 Traversal 2.0"
|
||||
* @return A list of DOM implementations that support the desired features
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSException.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSEXCEPTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSEXCEPTION_HPP
|
||||
|
||||
#include <xercesc/dom/DOMException.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Parser or write operations may throw an LSException if the processing is stopped.
|
||||
* The processing can be stopped due to a <code>DOMError</code> with a severity of
|
||||
* DOMError::DOM_SEVERITY_FATAL_ERROR or a non recovered DOMError::DOM_SEVERITY_ERROR,
|
||||
* or if <code>DOMErrorHandler::handleError()</code> returned <code>false</code>.
|
||||
* <p><b>Note</b>: As suggested in the definition of the constants in the <code>DOMError</code>
|
||||
* interface, a DOM implementation may choose to continue after a fatal error, but the
|
||||
* resulting DOM tree is then implementation dependent.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/DOM3-LS.html'>
|
||||
* Document Object Model (DOM) Level 3 Load and Save Specification</a>.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
class MemoryManager;
|
||||
|
||||
class CDOM_EXPORT DOMLSException : public DOMException {
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Contants */
|
||||
//@{
|
||||
/**
|
||||
* ExceptionCode
|
||||
*
|
||||
* <p><code>PARSE_ERR:</code>
|
||||
* If an attempt was made to load a document, or an XML Fragment, using DOMLSParser
|
||||
* and the processing has been stopped.</p>
|
||||
*
|
||||
* <p><code>SERIALIZE_ERR:</code>
|
||||
* If an attempt was made to serialize a Node using LSSerializer and the processing
|
||||
* has been stopped.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum LSExceptionCode {
|
||||
PARSE_ERR = 81,
|
||||
SERIALIZE_ERR = 82
|
||||
};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Constructors */
|
||||
//@{
|
||||
/**
|
||||
* Default constructor for DOMLSException.
|
||||
*
|
||||
*/
|
||||
DOMLSException();
|
||||
|
||||
/**
|
||||
* Constructor which takes an error code and a message.
|
||||
*
|
||||
* @param code The error code which indicates the exception
|
||||
* @param messageCode The string containing the error message
|
||||
* @param memoryManager The memory manager used to (de)allocate memory
|
||||
*/
|
||||
DOMLSException(short code,
|
||||
short messageCode,
|
||||
MemoryManager* const memoryManager);
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*
|
||||
* @param other The object to be copied.
|
||||
*/
|
||||
DOMLSException(const DOMLSException &other);
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Destructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor. */
|
||||
//@{
|
||||
/**
|
||||
* Destructor for DOMLSException.
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSException();
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMLSException & operator = (const DOMLSException &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,274 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSInput.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSINPUT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSINPUT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class InputSource;
|
||||
|
||||
|
||||
/**
|
||||
* This interface represents a single input source for an XML entity.
|
||||
*
|
||||
* <p>This interface allows an application to encapsulate information about
|
||||
* an input source in a single object, which may include a public identifier,
|
||||
* a system identifier, a byte stream (possibly with a specified encoding),
|
||||
* and/or a character stream.</p>
|
||||
*
|
||||
* <p>There are two places that the application will deliver this input source
|
||||
* to the parser: as the argument to the parse method, or as the return value
|
||||
* of the DOMLSResourceResolver.resolveResource method.</p>
|
||||
*
|
||||
* <p>The DOMLSParser will use the DOMLSInput object to determine how to
|
||||
* read XML input. If there is a character stream available, the parser will
|
||||
* read that stream directly; if not, the parser will use a byte stream, if
|
||||
* available; if neither a character stream nor a byte stream is available,
|
||||
* the parser will attempt to open a URI connection to the resource identified
|
||||
* by the system identifier.</p>
|
||||
*
|
||||
* <p>A DOMLSInput object belongs to the application: the parser shall
|
||||
* never modify it in any way (it may modify a copy if necessary).</p>
|
||||
*
|
||||
* @see DOMLSParser#parse
|
||||
* @see DOMLSResourceResolver#resolveResource
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMLSInput
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSInput() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSInput(const DOMLSInput &);
|
||||
DOMLSInput & operator = (const DOMLSInput &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSInput() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSInput interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* String data to parse. If provided, this will always be treated as a sequence of 16-bit units (UTF-16 encoded characters).
|
||||
* It is not a requirement to have an XML declaration when using stringData. If an XML declaration is present, the value of
|
||||
* the encoding attribute will be ignored.
|
||||
*
|
||||
*/
|
||||
virtual const XMLCh* getStringData() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the byte stream for this input source.
|
||||
*
|
||||
* @see InputSource
|
||||
*/
|
||||
virtual InputSource* getByteStream() const = 0;
|
||||
|
||||
/**
|
||||
* An input source can be set to force the parser to assume a particular
|
||||
* encoding for the data that input source reprsents, via the setEncoding()
|
||||
* method. This method returns name of the encoding that is to be forced.
|
||||
* If the encoding has never been forced, it returns a null pointer.
|
||||
*
|
||||
* @return The forced encoding, or null if none was supplied.
|
||||
* @see #setEncoding
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getEncoding() const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the public identifier for this input source.
|
||||
*
|
||||
* @return The public identifier, or null if none was supplied.
|
||||
* @see #setPublicId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getPublicId() const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the system identifier for this input source.
|
||||
*
|
||||
* <p>If the system ID is a URL, it will be fully resolved.</p>
|
||||
*
|
||||
* @return The system identifier.
|
||||
* @see #setSystemId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getSystemId() const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the base URI to be used for resolving relative URIs to absolute
|
||||
* URIs. If the baseURI is itself a relative URI, the behavior is
|
||||
* implementation dependent.
|
||||
*
|
||||
* @return The base URI.
|
||||
* @see #setBaseURI
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getBaseURI() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the UTF-16 string for this input source.
|
||||
*
|
||||
*/
|
||||
virtual void setStringData(const XMLCh* data) = 0;
|
||||
|
||||
/**
|
||||
* Sets the byte stream for this input source.
|
||||
*
|
||||
* @see BinInputStream
|
||||
*/
|
||||
virtual void setByteStream(InputSource* stream) = 0;
|
||||
|
||||
/**
|
||||
* Set the encoding which will be required for use with the XML text read
|
||||
* via a stream opened by this input source.
|
||||
*
|
||||
* <p>This is usually not set, allowing the encoding to be sensed in the
|
||||
* usual XML way. However, in some cases, the encoding in the file is known
|
||||
* to be incorrect because of intermediate transcoding, for instance
|
||||
* encapsulation within a MIME document.
|
||||
*
|
||||
* @param encodingStr The name of the encoding to force.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setEncoding(const XMLCh* const encodingStr) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Set the public identifier for this input source.
|
||||
*
|
||||
* <p>The public identifier is always optional: if the application writer
|
||||
* includes one, it will be provided as part of the location information.</p>
|
||||
*
|
||||
* @param publicId The public identifier as a string.
|
||||
* @see #getPublicId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setPublicId(const XMLCh* const publicId) = 0;
|
||||
|
||||
/**
|
||||
* Set the system identifier for this input source.
|
||||
*
|
||||
* <p>The system id is always required. The public id may be used to map
|
||||
* to another system id, but the system id must always be present as a fall
|
||||
* back.</p>
|
||||
*
|
||||
* <p>If the system ID is a URL, it must be fully resolved.</p>
|
||||
*
|
||||
* @param systemId The system identifier as a string.
|
||||
* @see #getSystemId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setSystemId(const XMLCh* const systemId) = 0;
|
||||
|
||||
/**
|
||||
* Set the base URI to be used for resolving relative URIs to absolute
|
||||
* URIs. If the baseURI is itself a relative URI, the behavior is
|
||||
* implementation dependent.
|
||||
*
|
||||
* @param baseURI The base URI.
|
||||
* @see #getBaseURI
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setBaseURI(const XMLCh* const baseURI) = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Indicates if the parser should issue fatal error if this input source
|
||||
* is not found. If set to false, the parser issue warning message instead.
|
||||
*
|
||||
* @param flag True if the parser should issue fatal error if this input source is not found.
|
||||
* If set to false, the parser issue warning message instead. (Default: true)
|
||||
*
|
||||
* @see #getIssueFatalErrorIfNotFound
|
||||
*/
|
||||
virtual void setIssueFatalErrorIfNotFound(bool flag) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the flag that indicates if the parser should issue fatal error if this input source
|
||||
* is not found.
|
||||
*
|
||||
* @return True if the parser should issue fatal error if this input source is not found.
|
||||
* False if the parser issue warning message instead.
|
||||
* @see #setIssueFatalErrorIfNotFound
|
||||
*/
|
||||
virtual bool getIssueFatalErrorIfNotFound() const = 0;
|
||||
|
||||
/**
|
||||
* Called to indicate that this DOMLSInput is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,169 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSOutput.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSOUTPUT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSOUTPUT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class XMLFormatTarget;
|
||||
|
||||
|
||||
/**
|
||||
* This interface represents an output destination for data.
|
||||
*
|
||||
* @see XMLFormatTarget
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMLSOutput
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSOutput() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSOutput(const DOMLSOutput &);
|
||||
DOMLSOutput & operator = (const DOMLSOutput &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSOutput() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSOutput interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the byte stream for this input source.
|
||||
*
|
||||
* @see InputSource
|
||||
*/
|
||||
virtual XMLFormatTarget* getByteStream() const = 0;
|
||||
|
||||
/**
|
||||
* An input source can be set to force the parser to assume a particular
|
||||
* encoding for the data that input source reprsents, via the setEncoding()
|
||||
* method. This method returns name of the encoding that is to be forced.
|
||||
* If the encoding has never been forced, it returns a null pointer.
|
||||
*
|
||||
* @return The forced encoding, or null if none was supplied.
|
||||
* @see #setEncoding
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getEncoding() const = 0;
|
||||
|
||||
/**
|
||||
* Get the system identifier for this input source.
|
||||
*
|
||||
* <p>If the system ID is a URL, it will be fully resolved.</p>
|
||||
*
|
||||
* @return The system identifier.
|
||||
* @see #setSystemId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getSystemId() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the byte stream for this input source.
|
||||
*
|
||||
* @see BinInputStream
|
||||
*/
|
||||
virtual void setByteStream(XMLFormatTarget* stream) = 0;
|
||||
|
||||
/**
|
||||
* Set the encoding which will be required for use with the XML text read
|
||||
* via a stream opened by this input source.
|
||||
*
|
||||
* <p>This is usually not set, allowing the encoding to be sensed in the
|
||||
* usual XML way. However, in some cases, the encoding in the file is known
|
||||
* to be incorrect because of intermediate transcoding, for instance
|
||||
* encapsulation within a MIME document.
|
||||
*
|
||||
* @param encodingStr The name of the encoding to force.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setEncoding(const XMLCh* const encodingStr) = 0;
|
||||
|
||||
/**
|
||||
* Set the system identifier for this input source.
|
||||
*
|
||||
* <p>The system id is always required. The public id may be used to map
|
||||
* to another system id, but the system id must always be present as a fall
|
||||
* back.</p>
|
||||
*
|
||||
* <p>If the system ID is a URL, it must be fully resolved.</p>
|
||||
*
|
||||
* @param systemId The system identifier as a string.
|
||||
* @see #getSystemId
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setSystemId(const XMLCh* const systemId) = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this DOMLSOutput is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,766 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSParser.hpp 832686 2009-11-04 08:55:59Z borisk $
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSPARSER_HPP
|
||||
|
||||
#include <xercesc/dom/DOMConfiguration.hpp>
|
||||
#include <xercesc/dom/DOMLSParserFilter.hpp>
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/validators/common/Grammar.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMErrorHandler;
|
||||
class DOMLSInput;
|
||||
class DOMNode;
|
||||
class DOMDocument;
|
||||
|
||||
/**
|
||||
* DOMLSParser provides an API for parsing XML documents and building the
|
||||
* corresponding DOM document tree. A DOMLSParser instance is obtained from
|
||||
* the DOMImplementationLS interface by invoking its createLSParser method.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*
|
||||
*/
|
||||
class CDOM_EXPORT DOMLSParser
|
||||
{
|
||||
protected :
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSParser() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSParser(const DOMLSParser &);
|
||||
DOMLSParser & operator = (const DOMLSParser &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSParser() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* A set of possible actions for the parseWithContext method.
|
||||
*
|
||||
* <p><code>ACTION_APPEND_AS_CHILDREN</code>:
|
||||
* Append the result of the parse operation as children of the context node.
|
||||
* For this action to work, the context node must be a <code>DOMElement</code>
|
||||
* or a <code>DOMDocumentFragment</code>. </p>
|
||||
*
|
||||
* <p><code>ACTION_INSERT_AFTER</code>:
|
||||
* Insert the result of the parse operation as the immediately following sibling
|
||||
* of the context node. For this action to work the context node's parent must
|
||||
* be a <code>DOMElement</code> or a <code>DOMDocumentFragment</code>. </p>
|
||||
*
|
||||
* <p><code>ACTION_INSERT_BEFORE</code>:
|
||||
* Insert the result of the parse operation as the immediately preceding sibling
|
||||
* of the context node. For this action to work the context node's parent must
|
||||
* be a <code>DOMElement</code> or a <code>DOMDocumentFragment</code>. </p>
|
||||
*
|
||||
* <p><code>ACTION_REPLACE</code>:
|
||||
* Replace the context node with the result of the parse operation. For this
|
||||
* action to work, the context node must have a parent, and the parent must be
|
||||
* a <code>DOMElement</code> or a <code>DOMDocumentFragment</code>. </p>
|
||||
*
|
||||
* <p><code>ACTION_REPLACE_CHILDREN</code>:
|
||||
* Replace all the children of the context node with the result of the parse
|
||||
* operation. For this action to work, the context node must be a <code>DOMElement</code>,
|
||||
* a <code>DOMDocument</code>, or a <code>DOMDocumentFragment</code>. </p>
|
||||
*
|
||||
* @see parseWithContext(...)
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum ActionType
|
||||
{
|
||||
ACTION_APPEND_AS_CHILDREN = 1,
|
||||
ACTION_REPLACE_CHILDREN = 2,
|
||||
ACTION_INSERT_BEFORE = 3,
|
||||
ACTION_INSERT_AFTER = 4,
|
||||
ACTION_REPLACE = 5
|
||||
};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSParser interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get a pointer to the <code>DOMConfiguration</code> object used when parsing
|
||||
* an input source.
|
||||
* This <code>DOMConfiguration</code> is specific to the parse operation.
|
||||
* No parameter values from this <code>DOMConfiguration</code> object are passed
|
||||
* automatically to the <code>DOMConfiguration</code> object on the
|
||||
* <code>DOMDocument</code> that is created, or used, by the parse operation.
|
||||
* The DOM application is responsible for passing any needed parameter values
|
||||
* from this <code>DOMConfiguration</code> object to the <code>DOMConfiguration</code>
|
||||
* object referenced by the <code>DOMDocument</code> object.
|
||||
*
|
||||
* In addition to the parameters recognized in on the <code>DOMConfiguration</code>
|
||||
* interface defined in [DOM Level 3 Core], the <code>DOMConfiguration</code> objects
|
||||
* for <code>DOMLSParser</code> add or modify the following parameters:
|
||||
*
|
||||
* "charset-overrides-xml-encoding"
|
||||
* true [optional] (default)
|
||||
* If a higher level protocol such as HTTP [IETF RFC 2616] provides an
|
||||
* indication of the character encoding of the input stream being processed,
|
||||
* that will override any encoding specified in the XML declaration or the
|
||||
* Text declaration (see also section 4.3.3, "Character Encoding in Entities",
|
||||
* in [XML 1.0]). Explicitly setting an encoding in the <code>DOMLSInput</code>
|
||||
* overrides any encoding from the protocol.
|
||||
* false [required]
|
||||
* The parser ignores any character set encoding information from higher-level
|
||||
* protocols.
|
||||
*
|
||||
* "disallow-doctype"
|
||||
* true [optional]
|
||||
* Throw a fatal "doctype-not-allowed" error if a doctype node is found while
|
||||
* parsing the document. This is useful when dealing with things like SOAP
|
||||
* envelopes where doctype nodes are not allowed.
|
||||
* false [required] (default)
|
||||
* Allow doctype nodes in the document.
|
||||
*
|
||||
* "ignore-unknown-character-denormalizations"
|
||||
* true [required] (default)
|
||||
* If, while verifying full normalization when [XML 1.1] is supported, a
|
||||
* processor encounters characters for which it cannot determine the normalization
|
||||
* properties, then the processor will ignore any possible denormalizations
|
||||
* caused by these characters.
|
||||
* This parameter is ignored for [XML 1.0].
|
||||
* false [optional]
|
||||
* Report an fatal "unknown-character-denormalization" error if a character
|
||||
* is encountered for which the processor cannot determine the normalization
|
||||
* properties.
|
||||
*
|
||||
* "infoset"
|
||||
* See the definition of DOMConfiguration for a description of this parameter.
|
||||
* Unlike in [DOM Level 3 Core], this parameter will default to true for DOMLSParser.
|
||||
*
|
||||
* "namespaces"
|
||||
* true [required] (default)
|
||||
* Perform the namespace processing as defined in [XML Namespaces] and
|
||||
* [XML Namespaces 1.1].
|
||||
* false [optional]
|
||||
* Do not perform the namespace processing.
|
||||
*
|
||||
* "resource-resolver" [required]
|
||||
* A pointer to a DOMLSResourceResolver object, or NULL. If the value of this parameter
|
||||
* is not null when an external resource (such as an external XML entity or an XML schema
|
||||
* location) is encountered, the implementation will request that the DOMLSResourceResolver
|
||||
* referenced in this parameter resolves the resource.
|
||||
*
|
||||
* "supported-media-types-only"
|
||||
* true [optional]
|
||||
* Check that the media type of the parsed resource is a supported media type. If
|
||||
* an unsupported media type is encountered, a fatal error of type "unsupported-media-type"
|
||||
* will be raised. The media types defined in [IETF RFC 3023] must always be accepted.
|
||||
* false [required] (default)
|
||||
* Accept any media type.
|
||||
*
|
||||
* "validate"
|
||||
* See the definition of <code>DOMConfiguration</code> for a description of this parameter.
|
||||
* Unlike in [DOM Level 3 Core], the processing of the internal subset is always accomplished, even
|
||||
* if this parameter is set to false.
|
||||
*
|
||||
* "validate-if-schema"
|
||||
* See the definition of <code>DOMConfiguration</code> for a description of this parameter.
|
||||
* Unlike in [DOM Level 3 Core], the processing of the internal subset is always accomplished, even
|
||||
* if this parameter is set to false.
|
||||
*
|
||||
* "well-formed"
|
||||
* See the definition of <code>DOMConfiguration</code> for a description of this parameter.
|
||||
* Unlike in [DOM Level 3 Core], this parameter cannot be set to false.
|
||||
*
|
||||
* In addition to these, Xerces adds these non standard parameters:
|
||||
*
|
||||
* "http://apache.org/xml/properties/entity-resolver"
|
||||
* A pointer to a XMLEntityResolver object, or NULL. If the value of this parameter
|
||||
* is not null when an external resource (such as an external XML entity or an XML schema
|
||||
* location) is encountered, the implementation will request that the XMLEntityResolver
|
||||
* referenced in this parameter resolves the resource.
|
||||
*
|
||||
* "http://apache.org/xml/properties/schema/external-schemaLocation"
|
||||
* A string holding a set of [namespaceUri schemaLocation] entries that will be treated as
|
||||
* the content of the attribute xsi:schemaLocation of the root element
|
||||
*
|
||||
* "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
|
||||
* A string holding the schemaLocation for the empty namespace URI that will be treated as
|
||||
* the content of the attribute xsi:noNamespaceSchemaLocation of the root element
|
||||
*
|
||||
* "http://apache.org/xml/properties/security-manager"
|
||||
* A pointer to a SecurityManager object that will control how many entity references will be
|
||||
* expanded during parsing
|
||||
*
|
||||
* "http://apache.org/xml/properties/scannerName"
|
||||
* A string holding the type of scanner used while parsing. The valid names are:
|
||||
* <ul>
|
||||
* <li>IGXMLScanner: the default one, capable of both XMLSchema and DTD validation</li>
|
||||
* <li>SGXMLScanner: a scanner that can only perform XMLSchema validation</li>
|
||||
* <li>DGXMLScanner: a scanner that can only perform DTD validation</li>
|
||||
* <li>WFXMLScanner: a scanner that cannot perform any type validation, only well-formedness</li>
|
||||
* </ul>
|
||||
*
|
||||
* "http://apache.org/xml/properties/parser-use-DOMDocument-from-Implementation"
|
||||
* A string holding the capabilities of the DOM implementation to be used to create the DOMDocument
|
||||
* resulting from the parse operation. For instance, "LS" or "Core"
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/schema"
|
||||
* true
|
||||
* Enable XMLSchema validation (note that also namespace processing should be enabled)
|
||||
* false (default)
|
||||
* Don't perform XMLSchema validation
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/schema-full-checking"
|
||||
* true
|
||||
* Turn on full XMLSchema checking (e.g. Unique Particle Attribution)
|
||||
* false (default)
|
||||
* Don't perform full XMLSchema checking
|
||||
*
|
||||
* "http://apache.org/xml/features/validating/load-schema"
|
||||
* true (default)
|
||||
* Allow the parser to load schemas that are not in the grammar pool
|
||||
* false
|
||||
* Schemas that are not in the grammar pool are ignored
|
||||
*
|
||||
* "http://apache.org/xml/features/dom/user-adopts-DOMDocument"
|
||||
* true
|
||||
* The DOMDocument objects returned by <code>parse</code> will be owned by the caller
|
||||
* false (default)
|
||||
* The DOMDocument objects returned by <code>parse</code> will be owned by this <code>DOMLSParser</code>
|
||||
* and deleted when released
|
||||
*
|
||||
* "http://apache.org/xml/features/nonvalidating/load-external-dtd"
|
||||
* true (default)
|
||||
* Allow the parser to load external DTDs
|
||||
* false
|
||||
* References to external DTDs will be ignored
|
||||
*
|
||||
* "http://apache.org/xml/features/continue-after-fatal-error"
|
||||
* true
|
||||
* Parsing should try to continue even if a fatal error has been triggered, trying to generate a DOM tree
|
||||
* from a non well-formed XML
|
||||
* false (default)
|
||||
* Violation of XML rules will abort parsing
|
||||
*
|
||||
* "http://apache.org/xml/features/validation-error-as-fatal"
|
||||
* true
|
||||
* Validation errors are treated as fatal errors, and abort parsing (unless "continue-after-fatal-error"
|
||||
* has been specified)
|
||||
* false (default)
|
||||
* Validation errors are normal errors
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/cache-grammarFromParse"
|
||||
* true
|
||||
* XMLSchemas referenced by an XML file are cached in order to be reused by other parse operations
|
||||
* false (default)
|
||||
* XMLSchemas loaded during a parse operation will be discarded before the next one
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/use-cachedGrammarInParse"
|
||||
* true
|
||||
* During this parse operation, reuse the XMLSchemas found in the cache
|
||||
* false (default)
|
||||
* Don't reuse the XMLSchemas found in the cache
|
||||
*
|
||||
* "http://apache.org/xml/features/calculate-src-ofs"
|
||||
* true
|
||||
* During parsing update the position in the source stream
|
||||
* false (default)
|
||||
* Don't waste time computing the position in the source stream
|
||||
*
|
||||
* "http://apache.org/xml/features/standard-uri-conformant"
|
||||
* true
|
||||
* Require that every URL being resolved is made of valid URL characters only
|
||||
* false (default)
|
||||
* Allow invalid URL characters in URL (e.g. spaces)
|
||||
*
|
||||
* "http://apache.org/xml/features/dom-has-psvi-info"
|
||||
* true
|
||||
* Add schema informations to DOMElement and DOMAttr nodes in the output DOM tree
|
||||
* false (default)
|
||||
* Don't store schema informations in the output DOM tree
|
||||
*
|
||||
* "http://apache.org/xml/features/generate-synthetic-annotations"
|
||||
* true
|
||||
* Create annotation objects in the representation of the loaded XMLSchemas
|
||||
* false (default)
|
||||
* Discard annotations found in the loaded XMLSchemas
|
||||
*
|
||||
* "http://apache.org/xml/features/validate-annotations"
|
||||
* true
|
||||
* Check that annotations are valid according to their XMLSchema definition
|
||||
* false (default)
|
||||
* Don't validate annotations
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/identity-constraint-checking"
|
||||
* true (default)
|
||||
* Enforce identity constraints specified in the XMLSchema
|
||||
* false
|
||||
* Don't enforce identity constraints
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/ignoreCachedDTD"
|
||||
* true
|
||||
* Don't reuse DTDs found in the cache, even if use-cachedGrammarInParse is <code>true</code>
|
||||
* false (default)
|
||||
* Reuse DTDs found in the cache, if use-cachedGrammarInParse is <code>true</code>
|
||||
*
|
||||
* "http://apache.org/xml/features/schema/ignore-annotations"
|
||||
* true
|
||||
* Don't process annotations found in an XMLSchema
|
||||
* false (default)
|
||||
* Process the annotations found in an XMLSchema
|
||||
*
|
||||
* "http://apache.org/xml/features/disable-default-entity-resolution"
|
||||
* true
|
||||
* Entities will be resolved only by a resolver installed by the user
|
||||
* false (default)
|
||||
* If the entity resolver has not been installed, or it refuses to resolve the given entity, the
|
||||
* parser will try to locate it himself
|
||||
*
|
||||
* "http://apache.org/xml/features/validation/schema/skip-dtd-validation"
|
||||
* true
|
||||
* If XMLSchema validation is <code>true</code>, DTD validation will not be performed
|
||||
* false (default)
|
||||
* If a DTD is found, it will be used to validate the XML
|
||||
*
|
||||
* @return The pointer to the configuration object.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMConfiguration* getDomConfig() = 0;
|
||||
|
||||
/**
|
||||
* Get a const pointer to the application filter
|
||||
*
|
||||
* This method returns the installed application filter. If no filter
|
||||
* has been installed, then it will be a zero pointer.
|
||||
*
|
||||
* @return A const pointer to the installed application filter
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const DOMLSParserFilter* getFilter() const = 0;
|
||||
|
||||
/**
|
||||
* Return whether the parser is asynchronous
|
||||
*
|
||||
* @return <code>true</code> if the <code>DOMLSParser</code> is asynchronous,
|
||||
* <code>false</code> if it is synchronous
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool getAsync() const = 0;
|
||||
|
||||
/**
|
||||
* Return whether the parser is busy parsing
|
||||
*
|
||||
* @return <code>true</code> if the <code>DOMLSParser</code> is currently busy
|
||||
* loading a document, otherwise <code>false</code>.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool getBusy() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Set the application filter
|
||||
*
|
||||
* When the application provides a filter, the parser will call out to
|
||||
* the filter at the completion of the construction of each <code>DOMElement</code>
|
||||
* node. The filter implementation can choose to remove the element from the
|
||||
* document being constructed or to terminate the parse early.
|
||||
* The filter is invoked after the operations requested by the DOMConfiguration
|
||||
* parameters have been applied. For example, if "validate" is set to true,
|
||||
* the validation is done before invoking the filter.
|
||||
*
|
||||
* <i>Any previously set filter is merely dropped, since the parser
|
||||
* does not own them.</i>
|
||||
*
|
||||
* @param filter A const pointer to the user supplied application
|
||||
* filter.
|
||||
*
|
||||
* @see #getFilter
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setFilter(DOMLSParserFilter* const filter) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Parsing methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Parse an XML document from a resource identified by a <code>DOMLSInput</code>.
|
||||
*
|
||||
* The parser owns the returned DOMDocument. It will be deleted
|
||||
* when the parser is released.
|
||||
*
|
||||
* @param source The <code>DOMLSInput</code> from which the source of the document
|
||||
* is to be read.
|
||||
* @return If the <code>DOMLSParser</code> is a synchronous <code>DOMLSParser</code>
|
||||
* the newly created and populated <code>DOMDocument</code> is returned.
|
||||
* If the <code>DOMLSParser</code> is asynchronous then <code>NULL</code>
|
||||
* is returned since the document object may not yet be constructed when
|
||||
* this method returns.
|
||||
* @exception DOMException INVALID_STATE_ERR: Raised if the <code>DOMLSParser::busy</code>
|
||||
* attribute is true.
|
||||
* @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is
|
||||
* raised if the <code>DOMLSParser</code> was unable
|
||||
* to load the XML document. DOM applications should
|
||||
* attach a <code>DOMErrorHandler</code> using the
|
||||
* parameter "error-handler" if they wish to get details
|
||||
* on the error.
|
||||
*
|
||||
* @see DOMLSInput#DOMLSInput
|
||||
* @see DOMConfiguration
|
||||
* @see resetDocumentPool
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMDocument* parse(const DOMLSInput* source) = 0;
|
||||
|
||||
/**
|
||||
* Parse an XML document from a location identified by a URI reference [IETF RFC 2396].
|
||||
* If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]),
|
||||
* the behavior is not defined by this specification, future versions of this
|
||||
* specification may define the behavior.
|
||||
*
|
||||
* The parser owns the returned DOMDocument. It will be deleted
|
||||
* when the parser is released.
|
||||
*
|
||||
* @param uri The location of the XML document to be read (in Unicode)
|
||||
* @return If the <code>DOMLSParser</code> is a synchronous <code>DOMLSParser</code>
|
||||
* the newly created and populated <code>DOMDocument</code> is returned.
|
||||
* If the <code>DOMLSParser</code> is asynchronous then <code>NULL</code>
|
||||
* is returned since the document object is not yet parsed when this method returns.
|
||||
* @exception DOMException INVALID_STATE_ERR: Raised if the <code>DOMLSParser::busy</code>
|
||||
* attribute is true.
|
||||
* @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is
|
||||
* raised if the <code>DOMLSParser</code> was unable
|
||||
* to load the XML document. DOM applications should
|
||||
* attach a <code>DOMErrorHandler</code> using the
|
||||
* parameter "error-handler" if they wish to get details
|
||||
* on the error.
|
||||
*
|
||||
* @see #parse(DOMLSInput,...)
|
||||
* @see resetDocumentPool
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMDocument* parseURI(const XMLCh* const uri) = 0;
|
||||
|
||||
/**
|
||||
* Parse an XML document from a location identified by a URI reference [IETF RFC 2396].
|
||||
* If the URI contains a fragment identifier (see section 4.1 in [IETF RFC 2396]),
|
||||
* the behavior is not defined by this specification, future versions of this
|
||||
* specification may define the behavior.
|
||||
*
|
||||
* The parser owns the returned DOMDocument. It will be deleted
|
||||
* when the parser is released.
|
||||
*
|
||||
* @param uri The location of the XML document to be read (in the local code page)
|
||||
* @return If the <code>DOMLSParser</code> is a synchronous <code>DOMLSParser</code>
|
||||
* the newly created and populated <code>DOMDocument</code> is returned.
|
||||
* If the <code>DOMLSParser</code> is asynchronous then <code>NULL</code>
|
||||
* is returned since the document object is not yet parsed when this method returns.
|
||||
* @exception DOMException INVALID_STATE_ERR: Raised if the <code>DOMLSParser::busy</code>
|
||||
* attribute is true.
|
||||
* @exception DOMLSException PARSE_ERR: Starting from Xerces-C++ 4.0.0 this exception is
|
||||
* raised if the <code>DOMLSParser</code> was unable
|
||||
* to load the XML document. DOM applications should
|
||||
* attach a <code>DOMErrorHandler</code> using the
|
||||
* parameter "error-handler" if they wish to get details
|
||||
* on the error.
|
||||
*
|
||||
* @see #parse(DOMLSInput,...)
|
||||
* @see resetDocumentPool
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMDocument* parseURI(const char* const uri) = 0;
|
||||
|
||||
/**
|
||||
* Parse an XML fragment from a resource identified by a <code>DOMLSInput</code>
|
||||
* and insert the content into an existing document at the position specified
|
||||
* with the context and action arguments. When parsing the input stream, the
|
||||
* context node (or its parent, depending on where the result will be inserted)
|
||||
* is used for resolving unbound namespace prefixes. The context node's
|
||||
* <code>ownerDocument</code> node (or the node itself if the node of type
|
||||
* <code>DOCUMENT_NODE</code>) is used to resolve default attributes and entity
|
||||
* references.
|
||||
* As the new data is inserted into the document, at least one mutation event
|
||||
* is fired per new immediate child or sibling of the context node.
|
||||
* If the context node is a <code>DOMDocument</code> node and the action is
|
||||
* <code>ACTION_REPLACE_CHILDREN</code>, then the document that is passed as
|
||||
* the context node will be changed such that its <code>xmlEncoding</code>,
|
||||
* <code>documentURI</code>, <code>xmlVersion</code>, <code>inputEncoding</code>,
|
||||
* <code>xmlStandalone</code>, and all other such attributes are set to what they
|
||||
* would be set to if the input source was parsed using <code>DOMLSParser::parse()</code>.
|
||||
* This method is always synchronous, even if the <code>DOMLSParser</code> is
|
||||
* asynchronous (<code>DOMLSParser::getAsync()</code> returns true).
|
||||
* If an error occurs while parsing, the caller is notified through the <code>ErrorHandler</code>
|
||||
* instance associated with the "error-handler" parameter of the <code>DOMConfiguration</code>.
|
||||
* When calling <code>parseWithContext</code>, the values of the following configuration
|
||||
* parameters will be ignored and their default values will always be used instead:
|
||||
* "validate",
|
||||
* "validate-if-schema"
|
||||
* "element-content-whitespace".
|
||||
* Other parameters will be treated normally, and the parser is expected to call
|
||||
* the <code>DOMLSParserFilter</code> just as if a whole document was parsed.
|
||||
*
|
||||
* @param source The <code>DOMLSInput</code> from which the source document is
|
||||
* to be read. The source document must be an XML fragment, i.e.
|
||||
* anything except a complete XML document (except in the case where
|
||||
* the context node of type <code>DOCUMENT_NODE</code>, and the action is
|
||||
* <code>ACTION_REPLACE_CHILDREN</code>), a <code>DOCTYPE</code>
|
||||
* (internal subset), entity declaration(s), notation declaration(s),
|
||||
* or XML or text declaration(s).
|
||||
* @param contextNode The node that is used as the context for the data that is being
|
||||
* parsed. This node must be a <code>DOMDocument</code> node, a
|
||||
* <code>DOMDocumentFragment</code> node, or a node of a type that
|
||||
* is allowed as a child of an <code>DOMElement</code> node, e.g.
|
||||
* it cannot be an <code>DOMAttribute</code> node.
|
||||
* @param action This parameter describes which action should be taken between the new
|
||||
* set of nodes being inserted and the existing children of the context node.
|
||||
* The set of possible actions is defined in <code>ACTION_TYPES</code> above.
|
||||
* @return Return the node that is the result of the parse operation. If the result is more
|
||||
* than one top-level node, the first one is returned.
|
||||
*
|
||||
* @exception DOMException
|
||||
* HIERARCHY_REQUEST_ERR: Raised if the content cannot replace, be inserted before, after,
|
||||
* or as a child of the context node (see also <code>DOMNode::insertBefore</code>
|
||||
* or <code>DOMNode::replaceChild</code> in [DOM Level 3 Core]).
|
||||
* NOT_SUPPORTED_ERR: Raised if the <code>DOMLSParser</code> doesn't support this method,
|
||||
* or if the context node is of type <code>DOMDocument</code> and the DOM
|
||||
* implementation doesn't support the replacement of the <code>DOMDocumentType</code>
|
||||
* child or <code>DOMElement</code> child.
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if the context node is a read only node and the content
|
||||
* is being appended to its child list, or if the parent node of
|
||||
* the context node is read only node and the content is being
|
||||
* inserted in its child list.
|
||||
* INVALID_STATE_ERR: Raised if the <code>DOMLSParser::getBusy()</code> returns true.
|
||||
*
|
||||
* @exception DOMLSException PARSE_ERR: Raised if the <code>DOMLSParser</code> was unable to load
|
||||
* the XML fragment. DOM applications should attach a
|
||||
* <code>DOMErrorHandler</code> using the parameter "error-handler"
|
||||
* if they wish to get details on the error.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMNode* parseWithContext(const DOMLSInput* source, DOMNode* contextNode, const ActionType action) = 0;
|
||||
|
||||
/**
|
||||
* Abort the loading of the document that is currently being loaded by the <code>DOMLSParser</code>.
|
||||
* If the <code>DOMLSParser</code> is currently not busy, a call to this method does nothing.
|
||||
*
|
||||
* Note: invoking this method will remove the installed <code>DOMLSParserFilter</code> filter
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void abort() = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this DOMLSParser is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
|
||||
/** Reset the documents vector pool and release all the associated memory
|
||||
* back to the system.
|
||||
*
|
||||
* When parsing a document using a DOM parser, all memory allocated
|
||||
* for a DOM tree is associated to the DOM document.
|
||||
*
|
||||
* If you do multiple parse using the same DOM parser instance, then
|
||||
* multiple DOM documents will be generated and saved in a vector pool.
|
||||
* All these documents (and thus all the allocated memory)
|
||||
* won't be deleted until the parser instance is destroyed.
|
||||
*
|
||||
* If you don't need these DOM documents anymore and don't want to
|
||||
* destroy the DOM parser instance at this moment, then you can call this method
|
||||
* to reset the document vector pool and release all the allocated memory
|
||||
* back to the system.
|
||||
*
|
||||
* It is an error to call this method if you are in the middle of a
|
||||
* parse (e.g. in the mid of a progressive parse).
|
||||
*
|
||||
* @exception IOException An exception from the parser if this function
|
||||
* is called when a parse is in progress.
|
||||
*
|
||||
*/
|
||||
virtual void resetDocumentPool() = 0;
|
||||
|
||||
/**
|
||||
* Preparse schema grammar (XML Schema, DTD, etc.) via an input source
|
||||
* object.
|
||||
*
|
||||
* This method invokes the preparsing process on a schema grammar XML
|
||||
* file specified by the DOMLSInput parameter. If the 'toCache' flag
|
||||
* is enabled, the parser will cache the grammars for re-use. If a grammar
|
||||
* key is found in the pool, no caching of any grammar will take place.
|
||||
*
|
||||
* @param source A const reference to the DOMLSInput object which
|
||||
* points to the schema grammar file to be preparsed.
|
||||
* @param grammarType The grammar type (Schema or DTD).
|
||||
* @param toCache If <code>true</code>, we cache the preparsed grammar,
|
||||
* otherwise, no chaching. Default is <code>false</code>.
|
||||
* @return The preparsed schema grammar object (SchemaGrammar or
|
||||
* DTDGrammar). That grammar object is owned by the parser.
|
||||
*
|
||||
* @exception SAXException Any SAX exception, possibly
|
||||
* wrapping another exception.
|
||||
* @exception XMLException An exception from the parser or client
|
||||
* handler code.
|
||||
* @exception DOMException A DOM exception as per DOM spec.
|
||||
*
|
||||
* @see DOMLSInput#DOMLSInput
|
||||
*/
|
||||
virtual Grammar* loadGrammar(const DOMLSInput* source,
|
||||
const Grammar::GrammarType grammarType,
|
||||
const bool toCache = false) = 0;
|
||||
|
||||
/**
|
||||
* Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
|
||||
*
|
||||
* This method invokes the preparsing process on a schema grammar XML
|
||||
* file specified by the file path parameter. If the 'toCache' flag is
|
||||
* enabled, the parser will cache the grammars for re-use. If a grammar
|
||||
* key is found in the pool, no caching of any grammar will take place.
|
||||
*
|
||||
* @param systemId A const XMLCh pointer to the Unicode string which
|
||||
* contains the path to the XML grammar file to be
|
||||
* preparsed.
|
||||
* @param grammarType The grammar type (Schema or DTD).
|
||||
* @param toCache If <code>true</code>, we cache the preparsed grammar,
|
||||
* otherwise, no chaching. Default is <code>false</code>.
|
||||
* @return The preparsed schema grammar object (SchemaGrammar or
|
||||
* DTDGrammar). That grammar object is owned by the parser.
|
||||
*
|
||||
* @exception SAXException Any SAX exception, possibly
|
||||
* wrapping another exception.
|
||||
* @exception XMLException An exception from the parser or client
|
||||
* handler code.
|
||||
* @exception DOMException A DOM exception as per DOM spec.
|
||||
*/
|
||||
virtual Grammar* loadGrammar(const XMLCh* const systemId,
|
||||
const Grammar::GrammarType grammarType,
|
||||
const bool toCache = false) = 0;
|
||||
|
||||
/**
|
||||
* Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
|
||||
*
|
||||
* This method invokes the preparsing process on a schema grammar XML
|
||||
* file specified by the file path parameter. If the 'toCache' flag is
|
||||
* enabled, the parser will cache the grammars for re-use. If a grammar
|
||||
* key is found in the pool, no caching of any grammar will take place.
|
||||
*
|
||||
* @param systemId A const char pointer to a native string which contains
|
||||
* the path to the XML grammar file to be preparsed.
|
||||
* @param grammarType The grammar type (Schema or DTD).
|
||||
* @param toCache If <code>true</code>, we cache the preparsed grammar,
|
||||
* otherwise, no chaching. Default is <code>false</code>.
|
||||
* @return The preparsed schema grammar object (SchemaGrammar or
|
||||
* DTDGrammar). That grammar object is owned by the parser.
|
||||
*
|
||||
*
|
||||
* @exception SAXException Any SAX exception, possibly
|
||||
* wrapping another exception.
|
||||
* @exception XMLException An exception from the parser or client
|
||||
* handler code.
|
||||
* @exception DOMException A DOM exception as per DOM spec.
|
||||
*/
|
||||
virtual Grammar* loadGrammar(const char* const systemId,
|
||||
const Grammar::GrammarType grammarType,
|
||||
const bool toCache = false) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve the grammar that is associated with the specified namespace key
|
||||
*
|
||||
* @param nameSpaceKey Namespace key
|
||||
* @return Grammar associated with the Namespace key.
|
||||
*/
|
||||
virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
|
||||
|
||||
/**
|
||||
* Retrieve the grammar where the root element is declared.
|
||||
*
|
||||
* @return Grammar where root element declared
|
||||
*/
|
||||
virtual Grammar* getRootGrammar() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the string corresponding to a URI id from the URI string pool.
|
||||
*
|
||||
* @param uriId id of the string in the URI string pool.
|
||||
* @return URI string corresponding to the URI id.
|
||||
*/
|
||||
virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
|
||||
|
||||
/**
|
||||
* Clear the cached grammar pool
|
||||
*/
|
||||
virtual void resetCachedGrammarPool() = 0;
|
||||
|
||||
/**
|
||||
* Returns the current src offset within the input source.
|
||||
*
|
||||
* @return offset within the input source
|
||||
*/
|
||||
virtual XMLFilePos getSrcOffset() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSParserFilter.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSPARSERFILTER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSPARSERFILTER_HPP
|
||||
|
||||
/**
|
||||
*
|
||||
* DOMLSParserFilter.hpp: interface for the DOMLSParserFilter class.
|
||||
*
|
||||
* DOMLSParserFilter provide applications the ability to examine nodes
|
||||
* as they are being created during the parse process.
|
||||
*
|
||||
* DOMLSParserFilter lets the application decide what nodes should be
|
||||
* in the output DOM tree or not.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMElement;
|
||||
class DOMNode;
|
||||
|
||||
class CDOM_EXPORT DOMLSParserFilter {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSParserFilter() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSParserFilter(const DOMLSParserFilter &);
|
||||
DOMLSParserFilter & operator = (const DOMLSParserFilter &);
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSParserFilter() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Contants */
|
||||
//@{
|
||||
/**
|
||||
* Constants returned by acceptNode.
|
||||
*
|
||||
* <p><code>FILTER_ACCEPT:</code>
|
||||
* Accept the node.</p>
|
||||
*
|
||||
* <p><code>FILTER_REJECT:</code>
|
||||
* Reject the node and its children.</p>
|
||||
*
|
||||
* <p><code>FILTER_SKIP:</code>
|
||||
* Skip this single node. The children of this node will still be considered.</p>
|
||||
*
|
||||
* <p><code>FILTER_INTERRUPT:</code>
|
||||
* Interrupt the normal processing of the document.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum FilterAction {FILTER_ACCEPT = 1,
|
||||
FILTER_REJECT = 2,
|
||||
FILTER_SKIP = 3,
|
||||
FILTER_INTERRUPT = 4};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSParserFilter interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* This method will be called by the parser at the completion of the parsing of each node.
|
||||
* The node and all of its descendants will exist and be complete. The parent node will also exist,
|
||||
* although it may be incomplete, i.e. it may have additional children that have not yet been parsed.
|
||||
* Attribute nodes are never passed to this function.
|
||||
* From within this method, the new node may be freely modified - children may be added or removed,
|
||||
* text nodes modified, etc. The state of the rest of the document outside this node is not defined,
|
||||
* and the affect of any attempt to navigate to, or to modify any other part of the document is undefined.
|
||||
* For validating parsers, the checks are made on the original document, before any modification by the
|
||||
* filter. No validity checks are made on any document modifications made by the filter.
|
||||
* If this new node is rejected, the parser might reuse the new node and any of its descendants.
|
||||
*
|
||||
* @param node The newly constructed element. At the time this method is called, the element is complete -
|
||||
* it has all of its children (and their children, recursively) and attributes, and is attached
|
||||
* as a child to its parent.
|
||||
* @return One of the FilterAction enum
|
||||
*/
|
||||
virtual FilterAction acceptNode(DOMNode* node) = 0;
|
||||
|
||||
/**
|
||||
* The parser will call this method after each <code>DOMElement</code> start tag has been scanned,
|
||||
* but before the remainder of the <code>DOMElement</code> is processed. The intent is to allow the element,
|
||||
* including any children, to be efficiently skipped. Note that only element nodes are passed to the
|
||||
* startElement function.
|
||||
* The element node passed to startElement for filtering will include all of the attributes, but none
|
||||
* of the children nodes. The <code>DOMElement</code> may not yet be in place in the document being
|
||||
* constructed (it may not have a parent node.)
|
||||
* A startElement filter function may access or change the attributes for the <code>DOMElement</code>.
|
||||
* Changing namespace declarations will have no effect on namespace resolution by the parser.
|
||||
*
|
||||
* @param node The newly encountered element. At the time this method is called, the element is incomplete -
|
||||
* it will have its attributes, but no children.
|
||||
* @return One of the FilterAction enum
|
||||
*/
|
||||
virtual FilterAction startElement(DOMElement* node) = 0;
|
||||
|
||||
/**
|
||||
* Tells the <code>DOMLSParser</code> what types of nodes to show to the method <code>DOMLSParserFilter::acceptNode</code>.
|
||||
* If a node is not shown to the filter using this attribute, it is automatically included in the DOM document being built.
|
||||
* See <code>DOMNodeFilter</code> for definition of the constants. The constants SHOW_ATTRIBUTE, SHOW_DOCUMENT,
|
||||
* SHOW_DOCUMENT_TYPE, SHOW_NOTATION, SHOW_ENTITY, and SHOW_DOCUMENT_FRAGMENT are meaningless here.
|
||||
* Those nodes will never be passed to DOMLSParserFilter::acceptNode.
|
||||
*
|
||||
* @return The constants of what types of nodes to show.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMNodeFilter::ShowType getWhatToShow() const = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSResourceResolver.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMLSInput;
|
||||
|
||||
/**
|
||||
* DOMLSResourceResolver provides a way for applications to redirect references
|
||||
* to external entities.
|
||||
*
|
||||
* <p>Applications needing to implement customized handling for external
|
||||
* entities must implement this interface and register their implementation
|
||||
* by setting the entityResolver attribute of the DOMLSParser.</p>
|
||||
*
|
||||
* <p>The DOMLSParser will then allow the application to intercept any
|
||||
* external entities (including the external DTD subset and external parameter
|
||||
* entities) before including them.</p>
|
||||
*
|
||||
* <p>Many DOM applications will not need to implement this interface, but it
|
||||
* will be especially useful for applications that build XML documents from
|
||||
* databases or other specialized input sources, or for applications that use
|
||||
* URNs.</p>
|
||||
*
|
||||
* @see DOMLSParser#getDomConfig
|
||||
* @see DOMLSInput#DOMLSInput
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMLSResourceResolver
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSResourceResolver() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSResourceResolver(const DOMLSResourceResolver &);
|
||||
DOMLSResourceResolver & operator = (const DOMLSResourceResolver &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSResourceResolver() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSResourceResolver interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* Allow the application to resolve external resources.
|
||||
*
|
||||
* The <code>DOMLSParser</code> will call this method before opening any external resource,
|
||||
* including the external DTD subset, external entities referenced within the DTD, and
|
||||
* external entities referenced within the document element (however, the top-level
|
||||
* document entity is not passed to this method). The application may then request that
|
||||
* the <code>DOMLSParser</code> resolve the external resource itself, that it use an
|
||||
* alternative URI, or that it use an entirely different input source.
|
||||
*
|
||||
* Application writers can use this method to redirect external system identifiers to
|
||||
* secure and/or local URI, to look up public identifiers in a catalogue, or to read
|
||||
* an entity from a database or other input source (including, for example, a dialog box).
|
||||
*
|
||||
* The returned DOMLSInput is owned by the DOMLSParser which is
|
||||
* responsible to clean up the memory.
|
||||
*
|
||||
* @param resourceType The type of the resource being resolved. For XML [XML 1.0] resources
|
||||
* (i.e. entities), applications must use the value "http://www.w3.org/TR/REC-xml".
|
||||
* For XML Schema [XML Schema Part 1], applications must use the value
|
||||
* "http://www.w3.org/2001/XMLSchema". Other types of resources are outside
|
||||
* the scope of this specification and therefore should recommend an absolute
|
||||
* URI in order to use this method.
|
||||
* @param namespaceUri The namespace of the resource being resolved, e.g. the target namespace
|
||||
* of the XML Schema [XML Schema Part 1] when resolving XML Schema resources.
|
||||
* @param publicId The public identifier of the external entity being referenced, or <code>null</code>
|
||||
* if no public identifier was supplied or if the resource is not an entity.
|
||||
* @param systemId The system identifier, a URI reference [IETF RFC 2396], of the external
|
||||
* resource being referenced, or <code>null</code> if no system identifier was supplied.
|
||||
* @param baseURI The absolute base URI of the resource being parsed, or <code>null</code> if
|
||||
* there is no base URI.
|
||||
* @return A DOMLSInput object describing the new input source,
|
||||
* or <code>null</code> to request that the parser open a regular
|
||||
* URI connection to the resource.
|
||||
* The returned DOMLSInput is owned by the DOMLSParser which is
|
||||
* responsible to clean up the memory.
|
||||
* @see DOMLSInput#DOMLSInput
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSInput* resolveResource( const XMLCh* const resourceType
|
||||
, const XMLCh* const namespaceUri
|
||||
, const XMLCh* const publicId
|
||||
, const XMLCh* const systemId
|
||||
, const XMLCh* const baseURI) = 0;
|
||||
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,547 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSSerializer.hpp 883665 2009-11-24 11:41:38Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZER_HPP
|
||||
|
||||
/**
|
||||
*
|
||||
* DOMLSSerializer provides an API for serializing (writing) a DOM document out in
|
||||
* an XML document. The XML data is written to an output stream, the type of
|
||||
* which depends on the specific language bindings in use. During
|
||||
* serialization of XML data, namespace fixup is done when possible.
|
||||
* <p> <code>DOMLSSerializer</code> accepts any node type for serialization. For
|
||||
* nodes of type <code>Document</code> or <code>Entity</code>, well formed
|
||||
* XML will be created if possible. The serialized output for these node
|
||||
* types is either as a Document or an External Entity, respectively, and is
|
||||
* acceptable input for an XML parser. For all other types of nodes the
|
||||
* serialized form is not specified, but should be something useful to a
|
||||
* human for debugging or diagnostic purposes. Note: rigorously designing an
|
||||
* external (source) form for stand-alone node types that don't already have
|
||||
* one defined in seems a bit much to take on here.
|
||||
* <p>Within a Document or Entity being serialized, Nodes are processed as
|
||||
* follows Documents are written including an XML declaration and a DTD
|
||||
* subset, if one exists in the DOM. Writing a document node serializes the
|
||||
* entire document. Entity nodes, when written directly by
|
||||
* <code>write</code> defined in the <code>DOMLSSerializer</code> interface,
|
||||
* output the entity expansion but no namespace fixup is done. The resulting
|
||||
* output will be valid as an external entity. Entity References nodes are
|
||||
* serializes as an entity reference of the form
|
||||
* <code>"&entityName;"</code>) in the output. Child nodes (the
|
||||
* expansion) of the entity reference are ignored. CDATA sections
|
||||
* containing content characters that can not be represented in the
|
||||
* specified output encoding are handled according to the
|
||||
* "split-cdata-sections" feature.If the feature is <code>true</code>, CDATA
|
||||
* sections are split, and the unrepresentable characters are serialized as
|
||||
* numeric character references in ordinary content. The exact position and
|
||||
* number of splits is not specified. If the feature is <code>false</code>,
|
||||
* unrepresentable characters in a CDATA section are reported as errors. The
|
||||
* error is not recoverable - there is no mechanism for supplying
|
||||
* alternative characters and continuing with the serialization. All other
|
||||
* node types (DOMElement, DOMText, etc.) are serialized to their corresponding
|
||||
* XML source form.
|
||||
* <p> Within the character data of a document (outside of markup), any
|
||||
* characters that cannot be represented directly are replaced with
|
||||
* character references. Occurrences of '<' and '&' are replaced by
|
||||
* the predefined entities &lt; and &amp. The other predefined
|
||||
* entities (&gt, &apos, etc.) are not used; these characters can be
|
||||
* included directly. Any character that can not be represented directly in
|
||||
* the output character encoding is serialized as a numeric character
|
||||
* reference.
|
||||
* <p> Attributes not containing quotes are serialized in quotes. Attributes
|
||||
* containing quotes but no apostrophes are serialized in apostrophes
|
||||
* (single quotes). Attributes containing both forms of quotes are
|
||||
* serialized in quotes, with quotes within the value represented by the
|
||||
* predefined entity &quot;. Any character that can not be represented
|
||||
* directly in the output character encoding is serialized as a numeric
|
||||
* character reference.
|
||||
* <p> Within markup, but outside of attributes, any occurrence of a character
|
||||
* that cannot be represented in the output character encoding is reported
|
||||
* as an error. An example would be serializing the element
|
||||
* <LaCañada/> with the encoding="us-ascii".
|
||||
* <p> When requested by setting the <code>normalize-characters</code> feature
|
||||
* on <code>DOMLSSerializer</code>, all data to be serialized, both markup and
|
||||
* character data, is W3C Text normalized according to the rules defined in
|
||||
* . The W3C Text normalization process affects only the data as it is being
|
||||
* written; it does not alter the DOM's view of the document after
|
||||
* serialization has completed.
|
||||
* <p>Namespaces are fixed up during serialization, the serialization process
|
||||
* will verify that namespace declarations, namespace prefixes and the
|
||||
* namespace URIs associated with Elements and Attributes are consistent. If
|
||||
* inconsistencies are found, the serialized form of the document will be
|
||||
* altered to remove them. The algorithm used for doing the namespace fixup
|
||||
* while seralizing a document is a combination of the algorithms used for
|
||||
* lookupNamespaceURI and lookupPrefix. previous paragraph to be
|
||||
* defined closer here.
|
||||
* <p>Any changes made affect only the namespace prefixes and declarations
|
||||
* appearing in the serialized data. The DOM's view of the document is not
|
||||
* altered by the serialization operation, and does not reflect any changes
|
||||
* made to namespace declarations or prefixes in the serialized output.
|
||||
* <p> While serializing a document the serializer will write out
|
||||
* non-specified values (such as attributes whose <code>specified</code> is
|
||||
* <code>false</code>) if the <code>output-default-values</code> feature is
|
||||
* set to <code>true</code>. If the <code>output-default-values</code> flag
|
||||
* is set to <code>false</code> and the <code>use-abstract-schema</code>
|
||||
* feature is set to <code>true</code> the abstract schema will be used to
|
||||
* determine if a value is specified or not, if
|
||||
* <code>use-abstract-schema</code> is not set the <code>specified</code>
|
||||
* flag on attribute nodes is used to determine if attribute values should
|
||||
* be written out.
|
||||
* <p> Ref to Core spec (1.1.9, XML namespaces, 5th paragraph) entity ref
|
||||
* description about warning about unbound entity refs. Entity refs are
|
||||
* always serialized as &foo;, also mention this in the load part of
|
||||
* this spec.
|
||||
* <p> When serializing a document the DOMLSSerializer checks to see if the document
|
||||
* element in the document is a DOM Level 1 element or a DOM Level 2 (or
|
||||
* higher) element (this check is done by looking at the localName of the
|
||||
* root element). If the root element is a DOM Level 1 element then the
|
||||
* DOMLSSerializer will issue an error if a DOM Level 2 (or higher) element is
|
||||
* found while serializing. Likewise if the document element is a DOM Level
|
||||
* 2 (or higher) element and the DOMLSSerializer sees a DOM Level 1 element an
|
||||
* error is issued. Mixing DOM Level 1 elements with DOM Level 2 (or higher)
|
||||
* is not supported.
|
||||
* <p> <code>DOMLSSerializer</code>s have a number of named features that can be
|
||||
* queried or set. The name of <code>DOMLSSerializer</code> features must be valid
|
||||
* XML names. Implementation specific features (extensions) should choose an
|
||||
* implementation dependent prefix to avoid name collisions.
|
||||
* <p>Here is a list of properties that must be recognized by all
|
||||
* implementations.
|
||||
* <dl>
|
||||
* <dt><code>"normalize-characters"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[
|
||||
* optional] (default) Perform the W3C Text Normalization of the characters
|
||||
* in document as they are written out. Only the characters being written
|
||||
* are (potentially) altered. The DOM document itself is unchanged. </dd>
|
||||
* <dt>
|
||||
* <code>false</code></dt>
|
||||
* <dd>[required] do not perform character normalization. </dd>
|
||||
* </dl></dd>
|
||||
* <dt>
|
||||
* <code>"split-cdata-sections"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[required] (default)
|
||||
* Split CDATA sections containing the CDATA section termination marker
|
||||
* ']]>' or characters that can not be represented in the output
|
||||
* encoding, and output the characters using numeric character references.
|
||||
* If a CDATA section is split a warning is issued. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[
|
||||
* required] Signal an error if a <code>CDATASection</code> contains an
|
||||
* unrepresentable character. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"validation"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[
|
||||
* optional] Use the abstract schema to validate the document as it is being
|
||||
* serialized. If validation errors are found the error handler is notified
|
||||
* about the error. Setting this state will also set the feature
|
||||
* <code>use-abstract-schema</code> to <code>true</code>. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[
|
||||
* required] (default) Don't validate the document as it is being
|
||||
* serialized. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"expand-entity-references"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[
|
||||
* optional] Expand <code>EntityReference</code> nodes when serializing. </dd>
|
||||
* <dt>
|
||||
* <code>false</code></dt>
|
||||
* <dd>[required] (default) Serialize all
|
||||
* <code>EntityReference</code> nodes as XML entity references. </dd>
|
||||
* </dl></dd>
|
||||
* <dt>
|
||||
* <code>"whitespace-in-element-content"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[required] (
|
||||
* default) Output all white spaces in the document. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[
|
||||
* optional] Only output white space that is not within element content. The
|
||||
* implementation is expected to use the
|
||||
* <code>isWhitespaceInElementContent</code> flag on <code>Text</code> nodes
|
||||
* to determine if a text node should be written out or not. </dd>
|
||||
* </dl></dd>
|
||||
* <dt>
|
||||
* <code>"discard-default-content"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[required] (default
|
||||
* ) Use whatever information available to the implementation (i.e. XML
|
||||
* schema, DTD, the <code>specified</code> flag on <code>Attr</code> nodes,
|
||||
* and so on) to decide what attributes and content should be serialized or
|
||||
* not. Note that the <code>specified</code> flag on <code>Attr</code> nodes
|
||||
* in itself is not always reliable, it is only reliable when it is set to
|
||||
* <code>false</code> since the only case where it can be set to
|
||||
* <code>false</code> is if the attribute was created by a Level 1
|
||||
* implementation. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[required] Output all attributes and
|
||||
* all content. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"format-canonical"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[optional]
|
||||
* This formatting writes the document according to the rules specified in .
|
||||
* Setting this feature to true will set the feature "format-pretty-print"
|
||||
* to false. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[required] (default) Don't canonicalize the
|
||||
* output. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"format-pretty-print"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[optional]
|
||||
* Formatting the output by adding whitespace to produce a pretty-printed,
|
||||
* indented, human-readable form. The exact form of the transformations is
|
||||
* not specified by this specification. Setting this feature to true will
|
||||
* set the feature "format-canonical" to false. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[required]
|
||||
* (default) Don't pretty-print the result. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"http://apache.org/xml/features/dom/byte-order-mark"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[optional]
|
||||
* (default) Setting this feature to true will output the correct BOM for the specified
|
||||
* encoding. </dd>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[required]
|
||||
* Don't generate a BOM. </dd>
|
||||
* </dl></dd>
|
||||
* <dt><code>"http://apache.org/xml/features/pretty-print/space-first-level-elements"</code></dt>
|
||||
* <dd>
|
||||
* <dl>
|
||||
* <dt><code>true</code></dt>
|
||||
* <dd>[optional]
|
||||
* (default) Setting this feature to true will add an extra line feed between the elements
|
||||
* that are children of the document root. </dd>
|
||||
* <dt><code>false</code></dt>
|
||||
* <dd>[required]
|
||||
* Don't add the extra line feed. </dd>
|
||||
* </dl></dd>
|
||||
* </dl>
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load and Save Specification</a>.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMLSSerializerFilter.hpp>
|
||||
#include <xercesc/dom/DOMErrorHandler.hpp>
|
||||
#include <xercesc/dom/DOMConfiguration.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMLSOutput;
|
||||
|
||||
class CDOM_EXPORT DOMLSSerializer
|
||||
{
|
||||
protected :
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSSerializer() {};
|
||||
//@}
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSSerializer(const DOMLSSerializer &);
|
||||
DOMLSSerializer & operator = (const DOMLSSerializer &);
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSSerializer() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSSerializer interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Feature methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The DOMConfiguration object used by the LSSerializer when serializing a DOM node.
|
||||
*
|
||||
* In addition to the parameters recognized in on the <code>DOMConfiguration</code>
|
||||
* interface defined in [DOM Level 3 Core], the <code>DOMConfiguration</code> objects
|
||||
* for <code>DOMLSSerializer</code> add or modify the following parameters:
|
||||
*
|
||||
* "canonical-form"
|
||||
* true [optional]
|
||||
* Writes the document according to the rules specified in [Canonical XML]. In addition to
|
||||
* the behavior described in "canonical-form" [DOM Level 3 Core], setting this parameter to
|
||||
* true will set the parameters "format-pretty-print", "discard-default-content", and
|
||||
* "xml-declaration", to false. Setting one of those parameters to true will set this
|
||||
* parameter to false. Serializing an XML 1.1 document when "canonical-form" is true will
|
||||
* generate a fatal error.
|
||||
* false [required] (default)
|
||||
* Do not canonicalize the output.
|
||||
*
|
||||
* "discard-default-content"
|
||||
* true [required] (default)
|
||||
* Use the DOMAttr::getSpecified attribute to decide what attributes should be discarded.
|
||||
* Note that some implementations might use whatever information available to the implementation
|
||||
* (i.e. XML schema, DTD, the DOMAttr::getSpecified attribute, and so on) to determine what
|
||||
* attributes and content to discard if this parameter is set to true.
|
||||
* false [required]
|
||||
* Keep all attributes and all content.
|
||||
*
|
||||
* "format-pretty-print"
|
||||
* true [optional]
|
||||
* Formatting the output by adding whitespace to produce a pretty-printed, indented,
|
||||
* human-readable form. The exact form of the transformations is not specified by this specification.
|
||||
* Pretty-printing changes the content of the document and may affect the validity of the document,
|
||||
* validating implementations should preserve validity.
|
||||
* false [required] (default)
|
||||
* Don't pretty-print the result.
|
||||
*
|
||||
* "ignore-unknown-character-denormalizations"
|
||||
* true [required] (default)
|
||||
* If, while verifying full normalization when [XML 1.1] is supported, a character is encountered
|
||||
* for which the normalization properties cannot be determined, then raise a "unknown-character-denormalization"
|
||||
* warning (instead of raising an error, if this parameter is not set) and ignore any possible
|
||||
* denormalizations caused by these characters.
|
||||
* false [optional]
|
||||
* Report a fatal error if a character is encountered for which the processor cannot determine the
|
||||
* normalization properties.
|
||||
*
|
||||
* "normalize-characters"
|
||||
* This parameter is equivalent to the one defined by <code>DOMConfiguration</code> in [DOM Level 3 Core].
|
||||
* Unlike in the Core, the default value for this parameter is true. While DOM implementations are not
|
||||
* required to support fully normalizing the characters in the document according to appendix E of [XML 1.1],
|
||||
* this parameter must be activated by default if supported.
|
||||
*
|
||||
* "xml-declaration"
|
||||
* true [required] (default)
|
||||
* If a DOMDocument, DOMElement, or DOMEntity node is serialized, the XML declaration, or text declaration,
|
||||
* should be included. The version (DOMDocument::xmlVersion if the document is a Level 3 document and the
|
||||
* version is non-null, otherwise use the value "1.0"), and the output encoding (see DOMLSSerializer::write
|
||||
* for details on how to find the output encoding) are specified in the serialized XML declaration.
|
||||
* false [required]
|
||||
* Do not serialize the XML and text declarations. Report a "xml-declaration-needed" warning if this will
|
||||
* cause problems (i.e. the serialized data is of an XML version other than [XML 1.0], or an encoding would
|
||||
* be needed to be able to re-parse the serialized data).
|
||||
*
|
||||
* "error-handler"
|
||||
* Contains a DOMErrorHandler object. If an error is encountered in the document, the implementation will call back
|
||||
* the DOMErrorHandler registered using this parameter. The implementation may provide a default DOMErrorHandler
|
||||
* object. When called, DOMError::relatedData will contain the closest node to where the error occurred.
|
||||
* If the implementation is unable to determine the node where the error occurs, DOMError::relatedData will contain
|
||||
* the DOMDocument node. Mutations to the document from within an error handler will result in implementation
|
||||
* dependent behavior.
|
||||
*
|
||||
* @return The pointer to the configuration object.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMConfiguration* getDomConfig() = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The end-of-line sequence of characters to be used in the XML being
|
||||
* written out. The only permitted values are these:
|
||||
* <dl>
|
||||
* <dt><code>null</code></dt>
|
||||
* <dd>
|
||||
* Use a default end-of-line sequence. DOM implementations should choose
|
||||
* the default to match the usual convention for text files in the
|
||||
* environment being used. Implementations must choose a default
|
||||
* sequence that matches one of those allowed by 2.11 "End-of-Line
|
||||
* Handling". However, Xerces-C++ always uses LF when this
|
||||
* property is set to <code>null</code> since otherwise automatic
|
||||
* translation of LF to CR-LF on Windows for text files would
|
||||
* result in such files containing CR-CR-LF. If you need Windows-style
|
||||
* end of line sequences in your output, consider writing to a file
|
||||
* opened in text mode or explicitly set this property to CR-LF.</dd>
|
||||
* <dt>CR</dt>
|
||||
* <dd>The carriage-return character (\#xD).</dd>
|
||||
* <dt>CR-LF</dt>
|
||||
* <dd> The
|
||||
* carriage-return and line-feed characters (\#xD \#xA). </dd>
|
||||
* <dt>LF</dt>
|
||||
* <dd> The line-feed
|
||||
* character (\#xA). </dd>
|
||||
* </dl>
|
||||
* <br>The default value for this attribute is <code>null</code>.
|
||||
*
|
||||
* @param newLine The end-of-line sequence of characters to be used.
|
||||
* @see getNewLine
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setNewLine(const XMLCh* const newLine) = 0;
|
||||
|
||||
/**
|
||||
* When the application provides a filter, the serializer will call out
|
||||
* to the filter before serializing each Node. Attribute nodes are never
|
||||
* passed to the filter. The filter implementation can choose to remove
|
||||
* the node from the stream or to terminate the serialization early.
|
||||
*
|
||||
* @param filter The writer filter to be used.
|
||||
* @see getFilter
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setFilter(DOMLSSerializerFilter *filter) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Return the end-of-line sequence of characters to be used in the XML being
|
||||
* written out.
|
||||
*
|
||||
* @return The end-of-line sequence of characters to be used.
|
||||
* @see setNewLine
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getNewLine() const = 0;
|
||||
|
||||
/**
|
||||
* Return the WriterFilter used.
|
||||
*
|
||||
* @return The writer filter used.
|
||||
* @see setFilter
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMLSSerializerFilter* getFilter() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Write methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Write out the specified node as described above in the description of
|
||||
* <code>DOMLSSerializer</code>. Writing a Document or Entity node produces a
|
||||
* serialized form that is well formed XML. Writing other node types
|
||||
* produces a fragment of text in a form that is not fully defined by
|
||||
* this document, but that should be useful to a human for debugging or
|
||||
* diagnostic purposes.
|
||||
*
|
||||
* @param nodeToWrite The <code>Document</code> or <code>Entity</code> node to
|
||||
* be written. For other node types, something sensible should be
|
||||
* written, but the exact serialized form is not specified.
|
||||
* @param destination The destination for the data to be written.
|
||||
* @return Returns <code>true</code> if <code>node</code> was
|
||||
* successfully serialized and <code>false</code> in case a failure
|
||||
* occured and the failure wasn't canceled by the error handler.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool write(const DOMNode* nodeToWrite,
|
||||
DOMLSOutput* const destination) = 0;
|
||||
|
||||
/**
|
||||
* Write out the specified node as described above in the description of
|
||||
* <code>DOMLSSerializer</code>. Writing a Document or Entity node produces a
|
||||
* serialized form that is well formed XML. Writing other node types
|
||||
* produces a fragment of text in a form that is not fully defined by
|
||||
* this document, but that should be useful to a human for debugging or
|
||||
* diagnostic purposes.
|
||||
*
|
||||
* @param nodeToWrite The <code>Document</code> or <code>Entity</code> node to
|
||||
* be written. For other node types, something sensible should be
|
||||
* written, but the exact serialized form is not specified.
|
||||
* @param uri The destination for the data to be written.
|
||||
* @return Returns <code>true</code> if <code>node</code> was
|
||||
* successfully serialized and <code>false</code> in case a failure
|
||||
* occured and the failure wasn't canceled by the error handler.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool writeToURI(const DOMNode* nodeToWrite,
|
||||
const XMLCh* uri) = 0;
|
||||
/**
|
||||
* Serialize the specified node as described above in the description of
|
||||
* <code>DOMLSSerializer</code>. The result of serializing the node is
|
||||
* returned as a string. Writing a Document or Entity node produces a
|
||||
* serialized form that is well formed XML. Writing other node types
|
||||
* produces a fragment of text in a form that is not fully defined by
|
||||
* this document, but that should be useful to a human for debugging or
|
||||
* diagnostic purposes.
|
||||
*
|
||||
* @param nodeToWrite The node to be written.
|
||||
* @param manager The memory manager to be used to allocate the result string.
|
||||
* If NULL is used, the memory manager used to construct the serializer will
|
||||
* be used.
|
||||
* @return Returns the serialized data, or <code>null</code> in case a
|
||||
* failure occured and the failure wasn't canceled by the error
|
||||
* handler. The returned string is always in UTF-16.
|
||||
* The encoding information available in DOMLSSerializer is ignored in writeToString().
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLCh* writeToString(const DOMNode* nodeToWrite, MemoryManager* manager = NULL) = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this Writer is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSSerializerFilter.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERFILTER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERFILTER_HPP
|
||||
|
||||
/**
|
||||
*
|
||||
* DOMLSSerializerFilter.hpp: interface for the DOMLSSerializerFilter class.
|
||||
*
|
||||
* DOMLSSerializerFilter provide applications the ability to examine nodes
|
||||
* as they are being serialized.
|
||||
*
|
||||
* DOMLSSerializerFilter lets the application decide what nodes should be
|
||||
* serialized or not.
|
||||
*
|
||||
* The DOMDocument, DOMDocumentType, DOMNotation, and DOMEntity nodes are not passed
|
||||
* to the filter.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMLSSerializerFilter : public DOMNodeFilter {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLSSerializerFilter() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLSSerializerFilter(const DOMLSSerializerFilter &);
|
||||
DOMLSSerializerFilter & operator = (const DOMLSSerializerFilter &);
|
||||
//@}
|
||||
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLSSerializerFilter() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLSSerializerFilter interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* Interface from <code>DOMNodeFilter</code>,
|
||||
* to be implemented by implementation (derived class)
|
||||
*/
|
||||
virtual FilterAction acceptNode(const DOMNode* node) const = 0;
|
||||
|
||||
/**
|
||||
* Tells the DOMLSSerializer what types of nodes to show to the filter.
|
||||
* See <code>DOMNodeFilter</code> for definition of the constants.
|
||||
* The constant SHOW_ATTRIBUTE is meaningless here, attribute nodes will
|
||||
* never be passed to a DOMLSSerializerFilter.
|
||||
*
|
||||
* @return The constants of what types of nodes to show.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual ShowType getWhatToShow() const =0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLocator.hpp 676853 2008-07-15 09:58:05Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATOR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLOCATOR_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
|
||||
|
||||
/**
|
||||
* DOMLocator is an interface that describes a location. (e.g. where an error
|
||||
* occured).
|
||||
*
|
||||
* @see DOMError#DOMError
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMLocator
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMLocator() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMLocator(const DOMLocator &);
|
||||
DOMLocator & operator = (const DOMLocator &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMLocator() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMLocator interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Get the line number where the error occured, or 0 if there is
|
||||
* no line number available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLFileLoc getLineNumber() const = 0;
|
||||
|
||||
/**
|
||||
* Get the column number where the error occured, or 0 if there
|
||||
* is no column number available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLFileLoc getColumnNumber() const = 0;
|
||||
|
||||
/**
|
||||
* Get the byte offset into the input source, or ~(XMLFilePos(0)) if
|
||||
* there is no byte offset available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLFilePos getByteOffset() const = 0;
|
||||
|
||||
/**
|
||||
* Get the UTF-16 offset into the input source, or ~(XMLFilePos(0)) if
|
||||
* there is no UTF-16 offset available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLFilePos getUtf16Offset() const = 0;
|
||||
|
||||
/**
|
||||
* Get the DOMNode where the error occured, or <code>null</code> if there
|
||||
* is no node available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMNode* getRelatedNode() const = 0;
|
||||
|
||||
/**
|
||||
* Get the URI where the error occured, or <code>null</code> if there is no
|
||||
* URI available.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getURI() const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMMEMORYMANAGER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMMEMORYMANAGER_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* The <code>DOMMemoryManager</code> interface exposes the memory allocation-related
|
||||
* functionalities of a <code>DOMDocument</code>
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMMemoryManager
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMMemoryManager() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMMemoryManager(const DOMMemoryManager &);
|
||||
DOMMemoryManager & operator = (const DOMMemoryManager &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMMemoryManager() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// data types
|
||||
// -----------------------------------------------------------------------
|
||||
enum NodeObjectType {
|
||||
ATTR_OBJECT = 0,
|
||||
ATTR_NS_OBJECT = 1,
|
||||
CDATA_SECTION_OBJECT = 2,
|
||||
COMMENT_OBJECT = 3,
|
||||
DOCUMENT_FRAGMENT_OBJECT = 4,
|
||||
DOCUMENT_TYPE_OBJECT = 5,
|
||||
ELEMENT_OBJECT = 6,
|
||||
ELEMENT_NS_OBJECT = 7,
|
||||
ENTITY_OBJECT = 8,
|
||||
ENTITY_REFERENCE_OBJECT = 9,
|
||||
NOTATION_OBJECT = 10,
|
||||
PROCESSING_INSTRUCTION_OBJECT = 11,
|
||||
TEXT_OBJECT = 12
|
||||
};
|
||||
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the size of the chunks of memory allocated by the memory manager
|
||||
*
|
||||
* @return the dimension of the chunks of memory allocated by the memory manager
|
||||
*/
|
||||
virtual XMLSize_t getMemoryAllocationBlockSize() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Set the size of the chunks of memory allocated by the memory manager
|
||||
*
|
||||
* @param size the new size of the chunks; it must be greater than 4KB
|
||||
*/
|
||||
virtual void setMemoryAllocationBlockSize(XMLSize_t size) = 0;
|
||||
//@}
|
||||
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Operations
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Allocate a memory block of the requested size from the managed pool
|
||||
*
|
||||
* @param amount the size of the new memory block
|
||||
*
|
||||
* @return the pointer to the newly allocated block
|
||||
*/
|
||||
virtual void* allocate(XMLSize_t amount) = 0;
|
||||
|
||||
/**
|
||||
* Allocate a memory block of the requested size from the managed pool of DOM objects
|
||||
*
|
||||
* @param amount the size of the new memory block
|
||||
* @param type the type of the DOM object that will be stored in the block
|
||||
*
|
||||
* @return the pointer to the newly allocated block
|
||||
*/
|
||||
virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type) = 0;
|
||||
|
||||
/**
|
||||
* Release a DOM object and place its memory back in the pool
|
||||
*
|
||||
* @param object the pointer to the DOM node
|
||||
* @param type the type of the DOM object
|
||||
*/
|
||||
virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type) = 0;
|
||||
|
||||
/**
|
||||
* Allocate a memory block from the mnaged pool and copy the provided string
|
||||
*
|
||||
* @param src the string to be copied
|
||||
*
|
||||
* @return the pointer to the newly allocated block
|
||||
*/
|
||||
virtual XMLCh* cloneString(const XMLCh *src) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMMemoryManager.hpp
|
||||
*/
|
||||
@@ -1,245 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNamedNodeMap.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAP_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAP_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
|
||||
/**
|
||||
* <code>DOMNamedNodeMap</code>s are used to
|
||||
* represent collections of nodes that can be accessed by name.
|
||||
*
|
||||
* Note that <code>DOMNamedNodeMap</code> does not inherit from <code>DOMNodeList</code>;
|
||||
* <code>DOMNamedNodeMap</code>s are not maintained in any particular order.
|
||||
* Nodes contained in a <code>DOMNamedNodeMap</code> may
|
||||
* also be accessed by an ordinal index, but this is simply to allow
|
||||
* convenient enumeration of the contents, and
|
||||
* does not imply that the DOM specifies an order to these Nodes.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMNamedNodeMap {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNamedNodeMap() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMNamedNodeMap(const DOMNamedNodeMap &);
|
||||
DOMNamedNodeMap & operator = (const DOMNamedNodeMap &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNamedNodeMap() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNamedNodeMap interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Adds a node using its <code>nodeName</code> attribute.
|
||||
*
|
||||
* <br>As the <code>nodeName</code> attribute is used to derive the name
|
||||
* which the node must be stored under, multiple nodes of certain types
|
||||
* (those that have a "special" string value) cannot be stored as the names
|
||||
* would clash. This is seen as preferable to allowing nodes to be aliased.
|
||||
* @param arg A node to store in a named node map. The node will later be
|
||||
* accessible using the value of the <code>nodeName</code> attribute of
|
||||
* the node. If a node with that name is already present in the map, it
|
||||
* is replaced by the new one.
|
||||
* @return If the new <code>DOMNode</code> replaces an existing node the
|
||||
* replaced <code>DOMNode</code> is returned,
|
||||
* otherwise <code>null</code> is returned.
|
||||
* @exception DOMException
|
||||
* WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
|
||||
* different document than the one that created the
|
||||
* <code>DOMNamedNodeMap</code>.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this
|
||||
* <code>DOMNamedNodeMap</code> is readonly.
|
||||
* <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
|
||||
* <code>DOMAttr</code> that is already an attribute of another
|
||||
* <code>DOMElement</code> object. The DOM user must explicitly clone
|
||||
* <code>DOMAttr</code> nodes to re-use them in other elements.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *setNamedItem(DOMNode *arg) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the <code>index</code>th item in the map.
|
||||
*
|
||||
* If <code>index</code>
|
||||
* is greater than or equal to the number of nodes in the map, this returns
|
||||
* <code>null</code>.
|
||||
* @param index Index into the map.
|
||||
* @return The node at the <code>index</code>th position in the
|
||||
* <code>DOMNamedNodeMap</code>, or <code>null</code> if that is not a valid
|
||||
* index.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *item(XMLSize_t index) const = 0;
|
||||
|
||||
/**
|
||||
* Retrieves a node specified by name.
|
||||
*
|
||||
* @param name The <code>nodeName</code> of a node to retrieve.
|
||||
* @return A <code>DOMNode</code> (of any type) with the specified <code>nodeName</code>, or
|
||||
* <code>null</code> if it does not identify any node in
|
||||
* the map.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getNamedItem(const XMLCh *name) const = 0;
|
||||
|
||||
/**
|
||||
* The number of nodes in the map.
|
||||
*
|
||||
* The range of valid child node indices is
|
||||
* 0 to <code>length-1</code> inclusive.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual XMLSize_t getLength() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Node methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Removes a node specified by name.
|
||||
*
|
||||
* If the removed node is an
|
||||
* <code>DOMAttr</code> with a default value it is immediately replaced.
|
||||
* @param name The <code>nodeName</code> of a node to remove.
|
||||
* @return The node removed from the map if a node with such a name exists.
|
||||
* @exception DOMException
|
||||
* NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
|
||||
* the map.
|
||||
* <br>
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>DOMNamedNodeMap</code>
|
||||
* is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *removeNamedItem(const XMLCh *name) = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
/**
|
||||
* Retrieves a node specified by local name and namespace URI.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the node to retrieve.
|
||||
* @param localName The <em>local name</em> of the node to retrieve.
|
||||
* @return A <code>DOMNode</code> (of any type) with the specified
|
||||
* local name and namespace URI, or <code>null</code> if they do not
|
||||
* identify any node in the map.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode *getNamedItemNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const = 0;
|
||||
|
||||
/**
|
||||
* Adds a node using its <CODE>namespaceURI</CODE> and <CODE>localName</CODE>.
|
||||
*
|
||||
* @param arg A node to store in a named node map. The node will later be
|
||||
* accessible using the value of the <CODE>namespaceURI</CODE> and
|
||||
* <CODE>localName</CODE> attribute of the node. If a node with those
|
||||
* namespace URI and local name is already present in the map, it is
|
||||
* replaced by the new one.
|
||||
* @return If the new <code>DOMNode</code> replaces an existing node the
|
||||
* replaced <code>DOMNode</code> is returned,
|
||||
* otherwise <code>null</code> is returned.
|
||||
* @exception DOMException
|
||||
* WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
|
||||
* different document than the one that created the
|
||||
* <code>DOMNamedNodeMap</code>.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this
|
||||
* <code>DOMNamedNodeMap</code> is readonly.
|
||||
* <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
|
||||
* <code>DOMAttr</code> that is already an attribute of another
|
||||
* <code>DOMElement</code> object. The DOM user must explicitly clone
|
||||
* <code>DOMAttr</code> nodes to re-use them in other elements.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode *setNamedItemNS(DOMNode *arg) = 0;
|
||||
|
||||
/**
|
||||
* Removes a node specified by local name and namespace URI.
|
||||
*
|
||||
* @param namespaceURI The <em>namespace URI</em> of
|
||||
* the node to remove.
|
||||
* @param localName The <em>local name</em> of the
|
||||
* node to remove. When this <code>DOMNamedNodeMap</code> contains the
|
||||
* attributes attached to an element, as returned by the attributes
|
||||
* attribute of the <code>DOMNode</code> interface, if the removed
|
||||
* attribute is known to have a default value, an attribute
|
||||
* immediately appears containing the default value
|
||||
* as well as the corresponding namespace URI, local name, and prefix.
|
||||
* @return The node removed from the map if a node with such a local name
|
||||
* and namespace URI exists.
|
||||
* @exception DOMException
|
||||
* NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
|
||||
* the map.
|
||||
* <br>
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>DOMNamedNodeMap</code>
|
||||
* is readonly.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode *removeNamedItemNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
#define GetDOMNamedNodeMapMemoryManager GET_INDIRECT_MM(fOwnerNode)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,922 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNode.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODE_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMDocument;
|
||||
class DOMNamedNodeMap;
|
||||
class DOMNodeList;
|
||||
class DOMUserDataHandler;
|
||||
|
||||
/**
|
||||
* The <code>DOMNode</code> interface is the primary datatype for the entire
|
||||
* Document Object Model. It represents a single node in the document tree.
|
||||
* While all objects implementing the <code>DOMNode</code> interface expose
|
||||
* methods for dealing with children, not all objects implementing the
|
||||
* <code>DOMNode</code> interface may have children. For example,
|
||||
* <code>DOMText</code> nodes may not have children, and adding children to
|
||||
* such nodes results in a <code>DOMException</code> being raised.
|
||||
* <p>The attributes <code>nodeName</code>, <code>nodeValue</code> and
|
||||
* <code>attributes</code> are included as a mechanism to get at node
|
||||
* information without casting down to the specific derived interface. In
|
||||
* cases where there is no obvious mapping of these attributes for a
|
||||
* specific <code>nodeType</code> (e.g., <code>nodeValue</code> for an
|
||||
* <code>DOMElement</code> or <code>attributes</code> for a <code>DOMComment</code>
|
||||
* ), this returns <code>null</code>. Note that the specialized interfaces
|
||||
* may contain additional and more convenient mechanisms to get and set the
|
||||
* relevant information.
|
||||
* <p>The values of <code>nodeName</code>,
|
||||
* <code>nodeValue</code>, and <code>attributes</code> vary according to the
|
||||
* node type as follows:
|
||||
* <table border='1'>
|
||||
* <tr>
|
||||
* <td>Interface</td>
|
||||
* <td>nodeName</td>
|
||||
* <td>nodeValue</td>
|
||||
* <td>attributes</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMAttr</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>name of attribute</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>value of attribute</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMCDATASection</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>"\#cdata-section"</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>content of the CDATA Section</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMComment</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>"\#comment"</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>content of the comment</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMDocument</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>"\#document"</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMDocumentFragment</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>"\#document-fragment"</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMDocumentType</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>document type name</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMElement</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>tag name</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>NamedNodeMap</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMEntity</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>entity name</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMEntityReference</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMNotation</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>notation name</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMProcessingInstruction</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>target</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>entire content excluding the target</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOMText</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>"\#text"</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>content of the text node</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>null</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNode() {}
|
||||
DOMNode(const DOMNode &) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMNode & operator = (const DOMNode &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNode() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* NodeType
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
enum NodeType {
|
||||
ELEMENT_NODE = 1,
|
||||
ATTRIBUTE_NODE = 2,
|
||||
TEXT_NODE = 3,
|
||||
CDATA_SECTION_NODE = 4,
|
||||
ENTITY_REFERENCE_NODE = 5,
|
||||
ENTITY_NODE = 6,
|
||||
PROCESSING_INSTRUCTION_NODE = 7,
|
||||
COMMENT_NODE = 8,
|
||||
DOCUMENT_NODE = 9,
|
||||
DOCUMENT_TYPE_NODE = 10,
|
||||
DOCUMENT_FRAGMENT_NODE = 11,
|
||||
NOTATION_NODE = 12
|
||||
};
|
||||
|
||||
/**
|
||||
* DocumentPosition:
|
||||
*
|
||||
* <p><code>DOCUMENT_POSITION_CONTAINED_BY:</code>
|
||||
* The node is contained by the reference node. A node which is contained is always following, too.</p>
|
||||
* <p><code>DOCUMENT_POSITION_CONTAINS:</code>
|
||||
* The node contains the reference node. A node which contains is always preceding, too.</p>
|
||||
* <p><code>DOCUMENT_POSITION_DISCONNECTED:</code>
|
||||
* The two nodes are disconnected. Order between disconnected nodes is always implementation-specific.</p>
|
||||
* <p><code>DOCUMENT_POSITION_FOLLOWING:</code>
|
||||
* The node follows the reference node.</p>
|
||||
* <p><code>DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:</code>
|
||||
* The determination of preceding versus following is implementation-specific.</p>
|
||||
* <p><code>DOCUMENT_POSITION_PRECEDING:</code>
|
||||
* The second node precedes the reference node.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum DocumentPosition {
|
||||
DOCUMENT_POSITION_DISCONNECTED = 0x01,
|
||||
DOCUMENT_POSITION_PRECEDING = 0x02,
|
||||
DOCUMENT_POSITION_FOLLOWING = 0x04,
|
||||
DOCUMENT_POSITION_CONTAINS = 0x08,
|
||||
DOCUMENT_POSITION_CONTAINED_BY = 0x10,
|
||||
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
|
||||
};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNode interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The name of this node, depending on its type; see the table above.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getNodeName() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the value of this node, depending on its type.
|
||||
*
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getNodeValue() const = 0;
|
||||
|
||||
/**
|
||||
* An enum value representing the type of the underlying object.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual NodeType getNodeType() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the parent of this node.
|
||||
*
|
||||
* All nodes, except <code>DOMDocument</code>,
|
||||
* <code>DOMDocumentFragment</code>, and <code>DOMAttr</code> may have a parent.
|
||||
* However, if a node has just been created and not yet added to the tree,
|
||||
* or if it has been removed from the tree, a <code>null</code> DOMNode
|
||||
* is returned.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getParentNode() const = 0;
|
||||
|
||||
/**
|
||||
* Gets a <code>DOMNodeList</code> that contains all children of this node.
|
||||
*
|
||||
* If there
|
||||
* are no children, this is a <code>DOMNodeList</code> containing no nodes.
|
||||
* The content of the returned <code>DOMNodeList</code> is "live" in the sense
|
||||
* that, for instance, changes to the children of the node object that
|
||||
* it was created from are immediately reflected in the nodes returned by
|
||||
* the <code>DOMNodeList</code> accessors; it is not a static snapshot of the
|
||||
* content of the node. This is true for every <code>DOMNodeList</code>,
|
||||
* including the ones returned by the <code>getElementsByTagName</code>
|
||||
* method.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNodeList *getChildNodes() const = 0;
|
||||
/**
|
||||
* Gets the first child of this node.
|
||||
*
|
||||
* If there is no such node, this returns <code>null</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getFirstChild() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the last child of this node.
|
||||
*
|
||||
* If there is no such node, this returns <code>null</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getLastChild() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the node immediately preceding this node.
|
||||
*
|
||||
* If there is no such node, this returns <code>null</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getPreviousSibling() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the node immediately following this node.
|
||||
*
|
||||
* If there is no such node, this returns <code>null</code>.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *getNextSibling() const = 0;
|
||||
|
||||
/**
|
||||
* Gets a <code>DOMNamedNodeMap</code> containing the attributes of this node (if it
|
||||
* is an <code>DOMElement</code>) or <code>null</code> otherwise.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNamedNodeMap *getAttributes() const = 0;
|
||||
|
||||
/**
|
||||
* Gets the <code>DOMDocument</code> object associated with this node.
|
||||
*
|
||||
* This is also
|
||||
* the <code>DOMDocument</code> object used to create new nodes. When this
|
||||
* node is a <code>DOMDocument</code> or a <code>DOMDocumentType</code>
|
||||
* which is not used with any <code>DOMDocument</code> yet, this is
|
||||
* <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMDocument *getOwnerDocument() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Node methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns a duplicate of this node.
|
||||
*
|
||||
* This function serves as a generic copy constructor for nodes.
|
||||
*
|
||||
* The duplicate node has no parent (
|
||||
* <code>parentNode</code> returns <code>null</code>.).
|
||||
* <br>Cloning an <code>DOMElement</code> copies all attributes and their
|
||||
* values, including those generated by the XML processor to represent
|
||||
* defaulted attributes, but this method does not copy any text it contains
|
||||
* unless it is a deep clone, since the text is contained in a child
|
||||
* <code>DOMText</code> node. Cloning any other type of node simply returns a
|
||||
* copy of this node.
|
||||
* @param deep If <code>true</code>, recursively clone the subtree under the
|
||||
* specified node; if <code>false</code>, clone only the node itself (and
|
||||
* its attributes, if it is an <code>DOMElement</code>).
|
||||
* @return The duplicate node.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode * cloneNode(bool deep) const = 0;
|
||||
|
||||
/**
|
||||
* Inserts the node <code>newChild</code> before the existing child node
|
||||
* <code>refChild</code>.
|
||||
*
|
||||
* If <code>refChild</code> is <code>null</code>,
|
||||
* insert <code>newChild</code> at the end of the list of children.
|
||||
* <br>If <code>newChild</code> is a <code>DOMDocumentFragment</code> object,
|
||||
* all of its children are inserted, in the same order, before
|
||||
* <code>refChild</code>. If the <code>newChild</code> is already in the
|
||||
* tree, it is first removed. Note that a <code>DOMNode</code> that
|
||||
* has never been assigned to refer to an actual node is == null.
|
||||
* @param newChild The node to insert.
|
||||
* @param refChild The reference node, i.e., the node before which the new
|
||||
* node must be inserted.
|
||||
* @return The node being inserted.
|
||||
* @exception DOMException
|
||||
* HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
|
||||
* allow children of the type of the <code>newChild</code> node, or if
|
||||
* the node to insert is one of this node's ancestors.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
|
||||
* from a different document than the one that created this node.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node being
|
||||
* inserted is readonly.
|
||||
* <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
|
||||
* this node.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *insertBefore(DOMNode *newChild,
|
||||
DOMNode *refChild) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the child node <code>oldChild</code> with <code>newChild</code>
|
||||
* in the list of children, and returns the <code>oldChild</code> node.
|
||||
*
|
||||
* If <CODE>newChild</CODE> is a <CODE>DOMDocumentFragment</CODE> object,
|
||||
* <CODE>oldChild</CODE> is replaced by all of the <CODE>DOMDocumentFragment</CODE>
|
||||
* children, which are inserted in the same order.
|
||||
*
|
||||
* If the <code>newChild</code> is already in the tree, it is first removed.
|
||||
* @param newChild The new node to put in the child list.
|
||||
* @param oldChild The node being replaced in the list.
|
||||
* @return The node replaced.
|
||||
* @exception DOMException
|
||||
* HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
|
||||
* allow children of the type of the <code>newChild</code> node, or it
|
||||
* the node to put in is one of this node's ancestors.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
|
||||
* from a different document than the one that created this node.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the new node is readonly.
|
||||
* <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
|
||||
* this node.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *replaceChild(DOMNode *newChild,
|
||||
DOMNode *oldChild) = 0;
|
||||
/**
|
||||
* Removes the child node indicated by <code>oldChild</code> from the list
|
||||
* of children, and returns it.
|
||||
*
|
||||
* @param oldChild The node being removed.
|
||||
* @return The node removed.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
|
||||
* this node.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *removeChild(DOMNode *oldChild) = 0;
|
||||
|
||||
/**
|
||||
* Adds the node <code>newChild</code> to the end of the list of children of
|
||||
* this node.
|
||||
*
|
||||
* If the <code>newChild</code> is already in the tree, it is
|
||||
* first removed.
|
||||
* @param newChild The node to add.If it is a <code>DOMDocumentFragment</code>
|
||||
* object, the entire contents of the document fragment are moved into
|
||||
* the child list of this node
|
||||
* @return The node added.
|
||||
* @exception DOMException
|
||||
* HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
|
||||
* allow children of the type of the <code>newChild</code> node, or if
|
||||
* the node to append is one of this node's ancestors.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
|
||||
* from a different document than the one that created this node.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node being
|
||||
* appended is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *appendChild(DOMNode *newChild) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Query methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* This is a convenience method to allow easy determination of whether a
|
||||
* node has any children.
|
||||
*
|
||||
* @return <code>true</code> if the node has any children,
|
||||
* <code>false</code> if the node has no children.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual bool hasChildNodes() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the value of the node.
|
||||
*
|
||||
* Any node which can have a nodeValue will
|
||||
* also accept requests to set it to a string. The exact response to
|
||||
* this varies from node to node -- Attribute, for example, stores
|
||||
* its values in its children and has to replace them with a new Text
|
||||
* holding the replacement value.
|
||||
*
|
||||
* For most types of Node, value is null and attempting to set it
|
||||
* will throw DOMException(NO_MODIFICATION_ALLOWED_ERR). This will
|
||||
* also be thrown if the node is read-only.
|
||||
* @see #getNodeValue
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void setNodeValue(const XMLCh *nodeValue) = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 2. */
|
||||
//@{
|
||||
/**
|
||||
* Puts all <CODE>DOMText</CODE>
|
||||
* nodes in the full depth of the sub-tree underneath this <CODE>DOMNode</CODE>,
|
||||
* including attribute nodes, into a "normal" form where only markup (e.g.,
|
||||
* tags, comments, processing instructions, CDATA sections, and entity
|
||||
* references) separates <CODE>DOMText</CODE>
|
||||
* nodes, i.e., there are neither adjacent <CODE>DOMText</CODE>
|
||||
* nodes nor empty <CODE>DOMText</CODE>
|
||||
* nodes. This can be used to ensure that the DOM view of a document is the
|
||||
* same as if it were saved and re-loaded, and is useful when operations
|
||||
* (such as XPointer lookups) that depend on a particular document tree
|
||||
* structure are to be used.
|
||||
* <P><B>Note:</B> In cases where the document contains <CODE>DOMCDATASections</CODE>,
|
||||
* the normalize operation alone may not be sufficient, since XPointers do
|
||||
* not differentiate between <CODE>DOMText</CODE>
|
||||
* nodes and <CODE>DOMCDATASection</CODE>
|
||||
* nodes.</P>
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void normalize() = 0;
|
||||
|
||||
/**
|
||||
* Tests whether the DOM implementation implements a specific
|
||||
* feature and that feature is supported by this node.
|
||||
*
|
||||
* @param feature The string of the feature to test. This is the same
|
||||
* name as what can be passed to the method <code>hasFeature</code> on
|
||||
* <code>DOMImplementation</code>.
|
||||
* @param version This is the version number of the feature to test. In
|
||||
* Level 2, version 1, this is the string "2.0". If the version is not
|
||||
* specified, supporting any version of the feature will cause the
|
||||
* method to return <code>true</code>.
|
||||
* @return Returns <code>true</code> if the specified feature is supported
|
||||
* on this node, <code>false</code> otherwise.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool isSupported(const XMLCh *feature,
|
||||
const XMLCh *version) const = 0;
|
||||
|
||||
/**
|
||||
* Get the <em>namespace URI</em> of
|
||||
* this node, or <code>null</code> if it is unspecified.
|
||||
* <p>
|
||||
* This is not a computed value that is the result of a namespace lookup
|
||||
* based on an examination of the namespace declarations in scope. It is
|
||||
* merely the namespace URI given at creation time.
|
||||
* <p>
|
||||
* For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and
|
||||
* <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method,
|
||||
* such as <CODE>createElement</CODE> from the <CODE>DOMDocument</CODE>
|
||||
* interface, this is always <CODE>null</CODE>.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getNamespaceURI() const = 0;
|
||||
|
||||
/**
|
||||
* Get the <em>namespace prefix</em>
|
||||
* of this node, or <code>null</code> if it is unspecified.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getPrefix() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the local part of the <em>qualified name</em> of this node.
|
||||
* <p>
|
||||
* For nodes created with a DOM Level 1 method, such as
|
||||
* <code>createElement</code> from the <code>DOMDocument</code> interface,
|
||||
* it is null.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh * getLocalName() const = 0;
|
||||
|
||||
/**
|
||||
* Set the <em>namespace prefix</em> of this node.
|
||||
* <p>
|
||||
* Note that setting this attribute, when permitted, changes
|
||||
* the <CODE>nodeName</CODE> attribute, which holds the <EM>qualified
|
||||
* name</EM>, as well as the <CODE>tagName</CODE> and <CODE>name</CODE>
|
||||
* attributes of the <CODE>DOMElement</CODE> and <CODE>DOMAttr</CODE>
|
||||
* interfaces, when applicable.
|
||||
* <p>
|
||||
* Note also that changing the prefix of an
|
||||
* attribute, that is known to have a default value, does not make a new
|
||||
* attribute with the default value and the original prefix appear, since the
|
||||
* <CODE>namespaceURI</CODE> and <CODE>localName</CODE> do not change.
|
||||
*
|
||||
*
|
||||
* @param prefix The prefix of this node.
|
||||
* @exception DOMException
|
||||
* INVALID_CHARACTER_ERR: Raised if the specified prefix contains
|
||||
* an illegal character.
|
||||
* <br>
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* <br>
|
||||
* NAMESPACE_ERR: Raised if the specified <CODE>prefix</CODE> is
|
||||
* malformed, if the <CODE>namespaceURI</CODE> of this node is
|
||||
* <CODE>null</CODE>, if the specified prefix is "xml" and the
|
||||
* <CODE>namespaceURI</CODE> of this node is different from
|
||||
* "http://www.w3.org/XML/1998/namespace", if this node is an attribute
|
||||
* and the specified prefix is "xmlns" and the
|
||||
* <CODE>namespaceURI</CODE> of this node is different from
|
||||
* "http://www.w3.org/2000/xmlns/", or if this node is an attribute and
|
||||
* the <CODE>qualifiedName</CODE> of this node is "xmlns".
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setPrefix(const XMLCh * prefix) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether this node (if it is an element) has any attributes.
|
||||
* @return <code>true</code> if this node has any attributes,
|
||||
* <code>false</code> otherwise.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool hasAttributes() const = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3. */
|
||||
//@{
|
||||
/**
|
||||
* Returns whether this node is the same node as the given one.
|
||||
* <br>This method provides a way to determine whether two
|
||||
* <code>DOMNode</code> references returned by the implementation reference
|
||||
* the same object. When two <code>DOMNode</code> references are references
|
||||
* to the same object, even if through a proxy, the references may be
|
||||
* used completely interchangeably, such that all attributes have the
|
||||
* same values and calling the same DOM method on either reference
|
||||
* always has exactly the same effect.
|
||||
*
|
||||
* @param other The node to test against.
|
||||
* @return Returns <code>true</code> if the nodes are the same,
|
||||
* <code>false</code> otherwise.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool isSameNode(const DOMNode* other) const = 0;
|
||||
|
||||
/**
|
||||
* Tests whether two nodes are equal.
|
||||
* <br>This method tests for equality of nodes, not sameness (i.e.,
|
||||
* whether the two nodes are pointers to the same object) which can be
|
||||
* tested with <code>DOMNode::isSameNode</code>. All nodes that are the same
|
||||
* will also be equal, though the reverse may not be true.
|
||||
* <br>Two nodes are equal if and only if the following conditions are
|
||||
* satisfied: The two nodes are of the same type.The following string
|
||||
* attributes are equal: <code>nodeName</code>, <code>localName</code>,
|
||||
* <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
|
||||
* , <code>baseURI</code>. This is: they are both <code>null</code>, or
|
||||
* they have the same length and are character for character identical.
|
||||
* The <code>attributes</code> <code>DOMNamedNodeMaps</code> are equal.
|
||||
* This is: they are both <code>null</code>, or they have the same
|
||||
* length and for each node that exists in one map there is a node that
|
||||
* exists in the other map and is equal, although not necessarily at the
|
||||
* same index.The <code>childNodes</code> <code>DOMNodeLists</code> are
|
||||
* equal. This is: they are both <code>null</code>, or they have the
|
||||
* same length and contain equal nodes at the same index. This is true
|
||||
* for <code>DOMAttr</code> nodes as for any other type of node. Note that
|
||||
* normalization can affect equality; to avoid this, nodes should be
|
||||
* normalized before being compared.
|
||||
* <br>For two <code>DOMDocumentType</code> nodes to be equal, the following
|
||||
* conditions must also be satisfied: The following string attributes
|
||||
* are equal: <code>publicId</code>, <code>systemId</code>,
|
||||
* <code>internalSubset</code>.The <code>entities</code>
|
||||
* <code>DOMNamedNodeMaps</code> are equal.The <code>notations</code>
|
||||
* <code>DOMNamedNodeMaps</code> are equal.
|
||||
* <br>On the other hand, the following do not affect equality: the
|
||||
* <code>ownerDocument</code> attribute, the <code>specified</code>
|
||||
* attribute for <code>DOMAttr</code> nodes, the
|
||||
* <code>isWhitespaceInElementContent</code> attribute for
|
||||
* <code>DOMText</code> nodes, as well as any user data or event listeners
|
||||
* registered on the nodes.
|
||||
*
|
||||
* @param arg The node to compare equality with.
|
||||
* @return If the nodes, and possibly subtrees are equal,
|
||||
* <code>true</code> otherwise <code>false</code>.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool isEqualNode(const DOMNode* arg) const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Associate an object to a key on this node. The object can later be
|
||||
* retrieved from this node by calling <code>getUserData</code> with the
|
||||
* same key.
|
||||
*
|
||||
* Deletion of the user data remains the responsibility of the
|
||||
* application program; it will not be automatically deleted when
|
||||
* the nodes themselves are reclaimed.
|
||||
*
|
||||
* Both the parameter <code>data</code> and the returned object are
|
||||
* void pointer, it is applications' responsibility to keep track of
|
||||
* their original type. Casting them to the wrong type may result
|
||||
* unexpected behavior.
|
||||
*
|
||||
* @param key The key to associate the object to.
|
||||
* @param data The object to associate to the given key, or
|
||||
* <code>null</code> to remove any existing association to that key.
|
||||
* @param handler The handler to associate to that key, or
|
||||
* <code>null</code>.
|
||||
* @return Returns the void* object previously associated to
|
||||
* the given key on this node, or <code>null</code> if there was none.
|
||||
* @see #getUserData
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* setUserData(const XMLCh* key,
|
||||
void* data,
|
||||
DOMUserDataHandler* handler) = 0;
|
||||
|
||||
/**
|
||||
* Retrieves the object associated to a key on a this node. The object
|
||||
* must first have been set to this node by calling
|
||||
* <code>setUserData</code> with the same key.
|
||||
*
|
||||
* @param key The key the object is associated to.
|
||||
* @return Returns the <code>void*</code> associated to the given key
|
||||
* on this node, or <code>null</code> if there was none.
|
||||
* @see #setUserData
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* getUserData(const XMLCh* key) const = 0;
|
||||
|
||||
|
||||
/**
|
||||
* The absolute base URI of this node or <code>null</code> if undefined.
|
||||
* This value is computed according to . However, when the
|
||||
* <code>DOMDocument</code> supports the feature "HTML" , the base URI is
|
||||
* computed using first the value of the href attribute of the HTML BASE
|
||||
* element if any, and the value of the <code>documentURI</code>
|
||||
* attribute from the <code>DOMDocument</code> interface otherwise.
|
||||
*
|
||||
* <br> When the node is an <code>DOMElement</code>, a <code>DOMDocument</code>
|
||||
* or a a <code>DOMProcessingInstruction</code>, this attribute represents
|
||||
* the properties [base URI] defined in . When the node is a
|
||||
* <code>DOMNotation</code>, an <code>DOMEntity</code>, or an
|
||||
* <code>DOMEntityReference</code>, this attribute represents the
|
||||
* properties [declaration base URI].
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getBaseURI() const = 0;
|
||||
|
||||
/**
|
||||
* Compares the reference node, i.e. the node on which this method is being called,
|
||||
* with a node, i.e. the one passed as a parameter, with regard to their position
|
||||
* in the document and according to the document order.
|
||||
*
|
||||
* @param other The node to compare against this node.
|
||||
* @return Returns how the given node is positioned relatively to this
|
||||
* node.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual short compareDocumentPosition(const DOMNode* other) const = 0;
|
||||
|
||||
/**
|
||||
* This attribute returns the text content of this node and its
|
||||
* descendants. No serialization is performed, the returned string
|
||||
* does not contain any markup. No whitespace normalization is
|
||||
* performed and the returned string does not contain the white
|
||||
* spaces in element content.
|
||||
*
|
||||
* <br>The string returned is made of the text content of this node
|
||||
* depending on its type, as defined below:
|
||||
* <table border='1'>
|
||||
* <tr>
|
||||
* <td>Node type</td>
|
||||
* <td>Content</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
|
||||
* DOCUMENT_FRAGMENT_NODE</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
|
||||
* attribute value of every child node, excluding COMMENT_NODE and
|
||||
* PROCESSING_INSTRUCTION_NODE nodes</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
|
||||
* CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* <code>nodeValue</code></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
|
||||
* <td valign='top' rowspan='1' colspan='1'>
|
||||
* null</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* @exception DOMException
|
||||
* DOMSTRING_SIZE_ERR: Raised when it would return more characters than
|
||||
* fit in a <code>DOMString</code> variable on the implementation
|
||||
* platform.
|
||||
* @see #setTextContent
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getTextContent() const = 0;
|
||||
|
||||
/**
|
||||
* This attribute removes any possible children this node may have and, if the
|
||||
* new string is not empty or null, replaced by a single <code>DOMText</code>
|
||||
* node containing the string this attribute is set to. No parsing is
|
||||
* performed, the input string is taken as pure textual content.
|
||||
*
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
|
||||
* @see #getTextContent
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void setTextContent(const XMLCh* textContent) = 0;
|
||||
|
||||
/**
|
||||
* Look up the prefix associated to the given namespace URI, starting from this node.
|
||||
* The default namespace declarations are ignored by this method.
|
||||
*
|
||||
* @param namespaceURI The namespace URI to look for.
|
||||
* @return Returns an associated namespace prefix if found,
|
||||
* <code>null</code> if none is found. If more
|
||||
* than one prefix are associated to the namespace prefix, the
|
||||
* returned namespace prefix is implementation dependent.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const = 0;
|
||||
|
||||
/**
|
||||
* This method checks if the specified <code>namespaceURI</code> is the
|
||||
* default namespace or not.
|
||||
*
|
||||
* @param namespaceURI The namespace URI to look for.
|
||||
* @return <code>true</code> if the specified <code>namespaceURI</code>
|
||||
* is the default namespace, <code>false</code> otherwise.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const = 0;
|
||||
|
||||
/**
|
||||
* Look up the namespace URI associated to the given prefix, starting from
|
||||
* this node.
|
||||
*
|
||||
* @param prefix The prefix to look for. If this parameter is
|
||||
* <code>null</code>, the method will return the default namespace URI
|
||||
* if any.
|
||||
* @return Returns the associated namespace URI or <code>null</code> if
|
||||
* none is found.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const = 0;
|
||||
|
||||
/**
|
||||
* This method makes available a <code>DOMNode</code>'s specialized interface
|
||||
*
|
||||
* @param feature The name of the feature requested (case-insensitive).
|
||||
* @param version The version of the feature requested.
|
||||
* @return Returns an alternate <code>DOMNode</code> which implements the
|
||||
* specialized APIs of the specified feature, if any, or
|
||||
* <code>null</code> if there is no alternate <code>DOMNode</code> which
|
||||
* implements interfaces associated with that feature. Any alternate
|
||||
* <code>DOMNode</code> returned by this method must delegate to the
|
||||
* primary core <code>DOMNode</code> and not return results inconsistent
|
||||
* with the primary core <code>DOMNode</code> such as <code>key</code>,
|
||||
* <code>attributes</code>, <code>childNodes</code>, etc.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this Node (and its associated children) is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it and
|
||||
* its associated children.
|
||||
*
|
||||
* If this is a document, any nodes it owns (created by DOMDocument::createXXXX())
|
||||
* are also released.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*
|
||||
* @exception DOMException
|
||||
* INVALID_ACCESS_ERR: Raised if this Node has a parent and thus should not be released yet.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
#if defined(XML_DOMREFCOUNT_EXPERIMENTAL)
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* This is custom function which can be implemented by classes deriving
|
||||
* from DOMNode for implementing reference counting on DOMNodes. Any
|
||||
* implementation which has memory management model which involves
|
||||
* disposing of nodes immediately after being used can override this
|
||||
* function to do that job.
|
||||
*/
|
||||
virtual void decRefCount() {}
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* This is custom function which can be implemented by classes deriving
|
||||
* from DOMNode for implementing reference counting on DOMNodes.
|
||||
*/
|
||||
virtual void incRefCount() {}
|
||||
//@}
|
||||
#endif
|
||||
};
|
||||
|
||||
/***
|
||||
* Utilities macros for getting memory manager within DOM
|
||||
***/
|
||||
#define GET_OWNER_DOCUMENT(ptr) \
|
||||
((DOMDocumentImpl*)(ptr->getOwnerDocument()))
|
||||
|
||||
#define GET_DIRECT_MM(ptr) \
|
||||
(ptr ? ((DOMDocumentImpl*)ptr)->getMemoryManager() : XMLPlatformUtils::fgMemoryManager)
|
||||
|
||||
#define GET_INDIRECT_MM(ptr) \
|
||||
(!ptr ? XMLPlatformUtils::fgMemoryManager : \
|
||||
GET_OWNER_DOCUMENT(ptr) ? GET_OWNER_DOCUMENT(ptr)->getMemoryManager() : \
|
||||
XMLPlatformUtils::fgMemoryManager)
|
||||
|
||||
/***
|
||||
* For DOMNode and its derivatives
|
||||
***/
|
||||
#define GetDOMNodeMemoryManager GET_INDIRECT_MM(this)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeFilter.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEFILTER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEFILTER_HPP
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Filters are objects that know how to "filter out" nodes. If a
|
||||
* <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> is given a
|
||||
* <code>DOMNodeFilter</code>, it applies the filter before it returns the next
|
||||
* node. If the filter says to accept the node, the traversal logic returns
|
||||
* it; otherwise, traversal looks for the next node and pretends that the
|
||||
* node that was rejected was not there.
|
||||
* <p>The DOM does not provide any filters. <code>DOMNodeFilter</code> is just an
|
||||
* interface that users can implement to provide their own filters.
|
||||
* <p><code>DOMNodeFilters</code> do not need to know how to traverse from node
|
||||
* to node, nor do they need to know anything about the data structure that
|
||||
* is being traversed. This makes it very easy to write filters, since the
|
||||
* only thing they have to know how to do is evaluate a single node. One
|
||||
* filter may be used with a number of different kinds of traversals,
|
||||
* encouraging code reuse.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMNodeFilter
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNodeFilter() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMNodeFilter(const DOMNodeFilter &);
|
||||
DOMNodeFilter & operator = (const DOMNodeFilter &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNodeFilter() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* Constants returned by acceptNode.
|
||||
*
|
||||
* <p><code>FILTER_ACCEPT:</code>
|
||||
* Accept the node. Navigation methods defined for
|
||||
* <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> will return this
|
||||
* node.</p>
|
||||
*
|
||||
* <p><code>FILTER_REJECT:</code>
|
||||
* Reject the node. Navigation methods defined for
|
||||
* <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> will not return
|
||||
* this node. For <code>DOMTreeWalker</code>, the children of this node
|
||||
* will also be rejected. <code>DOMNodeIterators</code> treat this as a
|
||||
* synonym for <code>FILTER_SKIP.</code></p>
|
||||
*
|
||||
* <p><code>FILTER_SKIP:</code>
|
||||
* Skip this single node. Navigation methods defined for
|
||||
* <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> will not return
|
||||
* this node. For both <code>DOMNodeIterator</code> and
|
||||
* <code>DOMTreeWalker</code>, the children of this node will still be
|
||||
* considered.</p>
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
enum FilterAction {FILTER_ACCEPT = 1,
|
||||
FILTER_REJECT = 2,
|
||||
FILTER_SKIP = 3};
|
||||
|
||||
/**
|
||||
* Constants for whatToShow
|
||||
*
|
||||
* <p><code>SHOW_ALL:</code>
|
||||
* Show all <code>DOMNode(s)</code>.</p>
|
||||
*
|
||||
* <p><code>SHOW_ELEMENT:</code>
|
||||
* Show <code>DOMElement</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_ATTRIBUTE:</code>
|
||||
* Show <code>DOMAttr</code> nodes. This is meaningful only when creating an
|
||||
* <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> with an
|
||||
* attribute node as its <code>root</code>; in this case, it means that
|
||||
* the attribute node will appear in the first position of the iteration
|
||||
* or traversal. Since attributes are never children of other nodes,
|
||||
* they do not appear when traversing over the document tree.</p>
|
||||
*
|
||||
* <p><code>SHOW_TEXT:</code>
|
||||
* Show <code>DOMText</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_CDATA_SECTION:</code>
|
||||
* Show <code>DOMCDATASection</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_ENTITY_REFERENCE:</code>
|
||||
* Show <code>DOMEntityReference</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_ENTITY:</code>
|
||||
* Show <code>DOMEntity</code> nodes. This is meaningful only when creating
|
||||
* an <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> with an
|
||||
* <code>DOMEntity</code> node as its <code>root</code>; in this case, it
|
||||
* means that the <code>DOMEntity</code> node will appear in the first
|
||||
* position of the traversal. Since entities are not part of the
|
||||
* document tree, they do not appear when traversing over the document
|
||||
* tree.</p>
|
||||
*
|
||||
* <p><code>SHOW_PROCESSING_INSTRUCTION:</code>
|
||||
* Show <code>DOMProcessingInstruction</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_COMMENT:</code>
|
||||
* Show <code>DOMComment</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_DOCUMENT:</code>
|
||||
* Show <code>DOMDocument</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_DOCUMENT_TYPE:</code>
|
||||
* Show <code>DOMDocumentType</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_DOCUMENT_FRAGMENT:</code>
|
||||
* Show <code>DOMDocumentFragment</code> nodes.</p>
|
||||
*
|
||||
* <p><code>SHOW_NOTATION:</code>
|
||||
* Show <code>DOMNotation</code> nodes. This is meaningful only when creating
|
||||
* an <code>DOMNodeIterator</code> or <code>DOMTreeWalker</code> with a
|
||||
* <code>DOMNotation</code> node as its <code>root</code>; in this case, it
|
||||
* means that the <code>DOMNotation</code> node will appear in the first
|
||||
* position of the traversal. Since notations are not part of the
|
||||
* document tree, they do not appear when traversing over the document
|
||||
* tree.</p>
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
enum ShowTypeMasks {
|
||||
SHOW_ALL = 0x0000FFFF,
|
||||
SHOW_ELEMENT = 0x00000001,
|
||||
SHOW_ATTRIBUTE = 0x00000002,
|
||||
SHOW_TEXT = 0x00000004,
|
||||
SHOW_CDATA_SECTION = 0x00000008,
|
||||
SHOW_ENTITY_REFERENCE = 0x00000010,
|
||||
SHOW_ENTITY = 0x00000020,
|
||||
SHOW_PROCESSING_INSTRUCTION = 0x00000040,
|
||||
SHOW_COMMENT = 0x00000080,
|
||||
SHOW_DOCUMENT = 0x00000100,
|
||||
SHOW_DOCUMENT_TYPE = 0x00000200,
|
||||
SHOW_DOCUMENT_FRAGMENT = 0x00000400,
|
||||
SHOW_NOTATION = 0x00000800
|
||||
};
|
||||
|
||||
typedef unsigned long ShowType;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNodeFilter interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
/**
|
||||
* Test whether a specified node is visible in the logical view of a
|
||||
* <code>DOMTreeWalker</code> or <code>DOMNodeIterator</code>. This function
|
||||
* will be called by the implementation of <code>DOMTreeWalker</code> and
|
||||
* <code>DOMNodeIterator</code>; it is not normally called directly from
|
||||
* user code. (Though you could do so if you wanted to use the same
|
||||
* filter to guide your own application logic.)
|
||||
* @param node The node to check to see if it passes the filter or not.
|
||||
* @return A constant to determine whether the node is accepted,
|
||||
* rejected, or skipped, as defined above.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual FilterAction acceptNode (const DOMNode* node) const =0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeIterator.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATOR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEITERATOR_HPP
|
||||
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* <code>DOMNodeIterators</code> are used to step through a set of nodes, e.g.
|
||||
* the set of nodes in a <code>DOMNodeList</code>, the document subtree
|
||||
* governed by a particular <code>DOMNode</code>, the results of a query, or
|
||||
* any other set of nodes. The set of nodes to be iterated is determined by
|
||||
* the implementation of the <code>DOMNodeIterator</code>. DOM Level 2
|
||||
* specifies a single <code>DOMNodeIterator</code> implementation for
|
||||
* document-order traversal of a document subtree. Instances of these
|
||||
* <code>DOMNodeIterators</code> are created by calling
|
||||
* <code>DOMDocumentTraversal</code><code>.createNodeIterator()</code>.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
class CDOM_EXPORT DOMNodeIterator
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNodeIterator() {}
|
||||
DOMNodeIterator(const DOMNodeIterator &) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMNodeIterator & operator = (const DOMNodeIterator &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNodeIterator() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNodeFilter interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The <code>root</code> node of the <code>DOMNodeIterator</code>, as specified
|
||||
* when it was created.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* getRoot() = 0;
|
||||
/**
|
||||
* Return which node types are presented via the iterator.
|
||||
* This attribute determines which node types are presented via the
|
||||
* <code>DOMNodeIterator</code>. The available set of constants is defined
|
||||
* in the <code>DOMNodeFilter</code> interface. Nodes not accepted by
|
||||
* <code>whatToShow</code> will be skipped, but their children may still
|
||||
* be considered. Note that this skip takes precedence over the filter,
|
||||
* if any.
|
||||
* @since DOM Level 2
|
||||
*
|
||||
*/
|
||||
virtual DOMNodeFilter::ShowType getWhatToShow() = 0;
|
||||
|
||||
/**
|
||||
* The <code>DOMNodeFilter</code> used to screen nodes.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNodeFilter* getFilter() = 0;
|
||||
|
||||
/**
|
||||
* Return the expandEntityReferences flag.
|
||||
* The value of this flag determines whether the children of entity
|
||||
* reference nodes are visible to the <code>DOMNodeIterator</code>. If
|
||||
* false, these children and their descendants will be rejected. Note
|
||||
* that this rejection takes precedence over <code>whatToShow</code> and
|
||||
* the filter. Also note that this is currently the only situation where
|
||||
* <code>DOMNodeIterators</code> may reject a complete subtree rather than
|
||||
* skipping individual nodes.
|
||||
* <br>
|
||||
* <br> To produce a view of the document that has entity references
|
||||
* expanded and does not expose the entity reference node itself, use
|
||||
* the <code>whatToShow</code> flags to hide the entity reference node
|
||||
* and set <code>expandEntityReferences</code> to true when creating the
|
||||
* <code>DOMNodeIterator</code>. To produce a view of the document that has
|
||||
* entity reference nodes but no entity expansion, use the
|
||||
* <code>whatToShow</code> flags to show the entity reference node and
|
||||
* set <code>expandEntityReferences</code> to false.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool getExpandEntityReferences() = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Query methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the next node in the set and advances the position of the
|
||||
* <code>DOMNodeIterator</code> in the set. After a
|
||||
* <code>DOMNodeIterator</code> is created, the first call to
|
||||
* <code>nextNode()</code> returns the first node in the set.
|
||||
* @return The next <code>DOMNode</code> in the set being iterated over, or
|
||||
* <code>null</code> if there are no more members in that set.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if this method is called after the
|
||||
* <code>detach</code> method was invoked.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* nextNode() = 0;
|
||||
|
||||
/**
|
||||
* Returns the previous node in the set and moves the position of the
|
||||
* <code>DOMNodeIterator</code> backwards in the set.
|
||||
* @return The previous <code>DOMNode</code> in the set being iterated over,
|
||||
* or <code>null</code> if there are no more members in that set.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if this method is called after the
|
||||
* <code>detach</code> method was invoked.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* previousNode() = 0;
|
||||
|
||||
/**
|
||||
* Detaches the <code>DOMNodeIterator</code> from the set which it iterated
|
||||
* over, releasing any computational resources and placing the
|
||||
* <code>DOMNodeIterator</code> in the INVALID state. After
|
||||
* <code>detach</code> has been invoked, calls to <code>nextNode</code>
|
||||
* or <code>previousNode</code> will raise the exception
|
||||
* INVALID_STATE_ERR.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void detach() = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this NodeIterator is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
* (release() will call detach() where appropriate)
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
#define GetDOMNodeIteratorMemoryManager GET_DIRECT_MM(fDocument)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeList.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODELIST_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODELIST_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMNodeList</code> interface provides the abstraction of an ordered
|
||||
* collection of nodes. DOMNodeLists are created by DOMDocument::getElementsByTagName(),
|
||||
* DOMNode::getChildNodes(),
|
||||
*
|
||||
* <p>The items in the <code>DOMNodeList</code> are accessible via an integral
|
||||
* index, starting from 0.
|
||||
*
|
||||
* DOMNodeLists are "live", in that any changes to the document tree are immediately
|
||||
* reflected in any DOMNodeLists that may have been created for that tree.
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMNodeList {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNodeList() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMNodeList(const DOMNodeList &);
|
||||
DOMNodeList & operator = (const DOMNodeList &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNodeList() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNodeList interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the <code>index</code> item in the collection.
|
||||
*
|
||||
* If <code>index</code> is greater than or equal to the number of nodes in
|
||||
* the list, this returns <code>null</code>.
|
||||
*
|
||||
* @param index Index into the collection.
|
||||
* @return The node at the <code>index</code>th position in the
|
||||
* <code>DOMNodeList</code>, or <code>null</code> if that is not a valid
|
||||
* index.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMNode *item(XMLSize_t index) const = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of nodes in the list.
|
||||
*
|
||||
* The range of valid child node indices is 0 to <code>length-1</code> inclusive.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual XMLSize_t getLength() const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNotation.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNOTATION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNOTATION_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* This interface represents a notation declared in the DTD. A notation either
|
||||
* declares, by name, the format of an unparsed entity (see section 4.7 of
|
||||
* the XML 1.0 specification), or is used for formal declaration of
|
||||
* Processing Instruction targets (see section 2.6 of the XML 1.0
|
||||
* specification). The <code>nodeName</code> attribute inherited from
|
||||
* <code>DOMNode</code> is set to the declared name of the notation.
|
||||
* <p>The DOM Level 1 does not support editing <code>DOMNotation</code> nodes;
|
||||
* they are therefore readonly.
|
||||
* <p>A <code>DOMNotation</code> node does not have any parent.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMNotation: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMNotation() {}
|
||||
DOMNotation(const DOMNotation &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMNotation & operator = (const DOMNotation &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMNotation() {};
|
||||
//@}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMNotation interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Get the public identifier of this notation.
|
||||
*
|
||||
* If the public identifier was not
|
||||
* specified, this is <code>null</code>.
|
||||
* @return Returns the public identifier of the notation
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh *getPublicId() const = 0;
|
||||
|
||||
/**
|
||||
* Get the system identifier of this notation.
|
||||
*
|
||||
* If the system identifier was not
|
||||
* specified, this is <code>null</code>.
|
||||
* @return Returns the system identifier of the notation
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh *getSystemId() const = 0;
|
||||
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMPSVITYPEINFO_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMPSVITYPEINFO_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* The <code>DOMPSVITypeInfo</code> interface represent the PSVI info used by
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code> nodes, specified in the
|
||||
* schemas associated with the document.
|
||||
*/
|
||||
class CDOM_EXPORT DOMPSVITypeInfo
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMPSVITypeInfo() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMPSVITypeInfo(const DOMPSVITypeInfo &);
|
||||
DOMPSVITypeInfo & operator = (const DOMPSVITypeInfo &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
||||
enum PSVIProperty
|
||||
{
|
||||
PSVI_Validity
|
||||
, PSVI_Validation_Attempted
|
||||
, PSVI_Type_Definition_Type
|
||||
, PSVI_Type_Definition_Name
|
||||
, PSVI_Type_Definition_Namespace
|
||||
, PSVI_Type_Definition_Anonymous
|
||||
, PSVI_Nil
|
||||
, PSVI_Member_Type_Definition_Name
|
||||
, PSVI_Member_Type_Definition_Namespace
|
||||
, PSVI_Member_Type_Definition_Anonymous
|
||||
, PSVI_Schema_Default
|
||||
, PSVI_Schema_Normalized_Value
|
||||
, PSVI_Schema_Specified
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMPSVITypeInfo() {};
|
||||
//@}
|
||||
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the string value of the specified PSVI property associated to a
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code>, or null if not available.
|
||||
*
|
||||
*
|
||||
* @return the string value of the specified PSVI property associated to a
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code>, or null if not available.
|
||||
*/
|
||||
virtual const XMLCh* getStringProperty(PSVIProperty prop) const = 0;
|
||||
|
||||
/**
|
||||
* Returns the numeric value of the specified PSVI property associated to a
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code>, or null if not available.
|
||||
*
|
||||
*
|
||||
* @return the numeric value of the specified PSVI property associated to a
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code>, or null if not available.
|
||||
*/
|
||||
virtual int getNumericProperty(PSVIProperty prop) const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMPSVITypeInfo.hpp
|
||||
*/
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMProcessingInstruction.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTION_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMProcessingInstruction</code> interface represents a "processing
|
||||
* instruction", used in XML as a way to keep processor-specific information
|
||||
* in the text of the document.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
class CDOM_EXPORT DOMProcessingInstruction: public DOMNode {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMProcessingInstruction() {}
|
||||
DOMProcessingInstruction(const DOMProcessingInstruction &other) : DOMNode(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMProcessingInstruction & operator = (const DOMProcessingInstruction &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMProcessingInstruction() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMProcessingInstruction interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The target of this processing instruction.
|
||||
*
|
||||
* XML defines this as being the
|
||||
* first token following the markup that begins the processing instruction.
|
||||
*
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getTarget() const = 0;
|
||||
|
||||
/**
|
||||
* The content of this processing instruction.
|
||||
*
|
||||
* This is from the first non
|
||||
* white space character after the target to the character immediately
|
||||
* preceding the <code>?></code>.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual const XMLCh * getData() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the content of this processing instruction.
|
||||
*
|
||||
* This is from the first non
|
||||
* white space character after the target to the character immediately
|
||||
* preceding the <code>?></code>.
|
||||
* @param data The string containing the processing instruction
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual void setData(const XMLCh * data) = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,530 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMRange.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMRANGE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMRANGE_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMNode;
|
||||
class DOMDocumentFragment;
|
||||
|
||||
/**
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
class CDOM_EXPORT DOMRange {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMRange() {}
|
||||
DOMRange(const DOMRange &) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMRange & operator = (const DOMRange &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMRange() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* Constants CompareHow.
|
||||
*
|
||||
* <p><code>START_TO_START:</code>
|
||||
* Compare start boundary-point of <code>sourceRange</code> to start
|
||||
* boundary-point of Range on which <code>compareBoundaryPoints</code>
|
||||
* is invoked.</p>
|
||||
*
|
||||
* <p><code>START_TO_END:</code>
|
||||
* Compare start boundary-point of <code>sourceRange</code> to end
|
||||
* boundary-point of Range on which <code>compareBoundaryPoints</code>
|
||||
* is invoked.</p>
|
||||
*
|
||||
* <p><code>END_TO_END:</code>
|
||||
* Compare end boundary-point of <code>sourceRange</code> to end
|
||||
* boundary-point of Range on which <code>compareBoundaryPoints</code>
|
||||
* is invoked.</p>
|
||||
*
|
||||
* <p><code>END_TO_START:</code>
|
||||
* Compare end boundary-point of <code>sourceRange</code> to start
|
||||
* boundary-point of Range on which <code>compareBoundaryPoints</code>
|
||||
* is invoked.</p>
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
enum CompareHow {
|
||||
START_TO_START = 0,
|
||||
START_TO_END = 1,
|
||||
END_TO_END = 2,
|
||||
END_TO_START = 3
|
||||
};
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMRange interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* DOMNode within which the Range begins
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* getStartContainer() const = 0;
|
||||
|
||||
/**
|
||||
* Offset within the starting node of the Range.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual XMLSize_t getStartOffset() const = 0;
|
||||
|
||||
/**
|
||||
* DOMNode within which the Range ends
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* getEndContainer() const = 0;
|
||||
|
||||
/**
|
||||
* Offset within the ending node of the Range.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual XMLSize_t getEndOffset() const = 0;
|
||||
|
||||
/**
|
||||
* TRUE if the Range is collapsed
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool getCollapsed() const = 0;
|
||||
|
||||
/**
|
||||
* The deepest common ancestor container of the Range's two
|
||||
* boundary-points.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const DOMNode* getCommonAncestorContainer() const = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the attributes describing the start of the Range.
|
||||
* @param refNode The <code>refNode</code> value. This parameter must be
|
||||
* different from <code>null</code>.
|
||||
* @param offset The <code>startOffset</code> value.
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
|
||||
* of <code>refNode</code> is an DOMEntity, DOMNotation, or DOMDocumentType
|
||||
* node.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
|
||||
* than the number of child units in <code>refNode</code>. Child units
|
||||
* are 16-bit units if <code>refNode</code> is a type of DOMCharacterData
|
||||
* node (e.g., a DOMText or DOMComment node) or a DOMProcessingInstruction
|
||||
* node. Child units are Nodes in all other cases.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setStart(const DOMNode *refNode, XMLSize_t offset) = 0;
|
||||
|
||||
/**
|
||||
* Sets the attributes describing the end of a Range.
|
||||
* @param refNode The <code>refNode</code> value. This parameter must be
|
||||
* different from <code>null</code>.
|
||||
* @param offset The <code>endOffset</code> value.
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
|
||||
* of <code>refNode</code> is an DOMEntity, DOMNotation, or DOMDocumentType
|
||||
* node.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
|
||||
* than the number of child units in <code>refNode</code>. Child units
|
||||
* are 16-bit units if <code>refNode</code> is a type of DOMCharacterData
|
||||
* node (e.g., a DOMText or DOMComment node) or a DOMProcessingInstruction
|
||||
* node. Child units are Nodes in all other cases.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setEnd(const DOMNode *refNode, XMLSize_t offset) = 0;
|
||||
|
||||
/**
|
||||
* Sets the start position to be before a node
|
||||
* @param refNode Range starts before <code>refNode</code>
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if the root container of
|
||||
* <code>refNode</code> is not an DOMAttr, DOMDocument, or DOMDocumentFragment
|
||||
* node or if <code>refNode</code> is a DOMDocument, DOMDocumentFragment,
|
||||
* DOMAttr, DOMEntity, or DOMNotation node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setStartBefore(const DOMNode *refNode) = 0;
|
||||
|
||||
/**
|
||||
* Sets the start position to be after a node
|
||||
* @param refNode Range starts after <code>refNode</code>
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if the root container of
|
||||
* <code>refNode</code> is not an DOMAttr, DOMDocument, or DOMDocumentFragment
|
||||
* node or if <code>refNode</code> is a DOMDocument, DOMDocumentFragment,
|
||||
* DOMAttr, DOMEntity, or DOMNotation node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setStartAfter(const DOMNode *refNode) = 0;
|
||||
|
||||
/**
|
||||
* Sets the end position to be before a node.
|
||||
* @param refNode Range ends before <code>refNode</code>
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if the root container of
|
||||
* <code>refNode</code> is not an DOMAttr, DOMDocument, or DOMDocumentFragment
|
||||
* node or if <code>refNode</code> is a DOMDocument, DOMDocumentFragment,
|
||||
* DOMAttr, DOMEntity, or DOMNotation node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setEndBefore(const DOMNode *refNode) = 0;
|
||||
|
||||
/**
|
||||
* Sets the end of a Range to be after a node
|
||||
* @param refNode Range ends after <code>refNode</code>.
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if the root container of
|
||||
* <code>refNode</code> is not a DOMAttr, DOMDocument or DOMDocumentFragment
|
||||
* node or if <code>refNode</code> is a DOMDocument, DOMDocumentFragment,
|
||||
* DOMAttr, DOMEntity, or DOMNotation node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setEndAfter(const DOMNode *refNode) = 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Misc methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Collapse a Range onto one of its boundary-points
|
||||
* @param toStart If TRUE, collapses the Range onto its start; if FALSE,
|
||||
* collapses it onto its end.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void collapse(bool toStart) = 0;
|
||||
|
||||
/**
|
||||
* Select a node and its contents
|
||||
* @param refNode The node to select.
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code>refNode</code>
|
||||
* is an DOMEntity, DOMNotation or DOMDocumentType node or if
|
||||
* <code>refNode</code> is a DOMDocument, DOMDocumentFragment, DOMAttr, DOMEntity,
|
||||
* or DOMNotation node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void selectNode(const DOMNode *refNode) = 0;
|
||||
|
||||
/**
|
||||
* Select the contents within a node
|
||||
* @param refNode DOMNode to select from
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
|
||||
* of <code>refNode</code> is an DOMEntity, DOMNotation or DOMDocumentType node.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
|
||||
* from a different document than the one that created this range.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void selectNodeContents(const DOMNode *refNode) = 0;
|
||||
|
||||
/**
|
||||
* Compare the boundary-points of two Ranges in a document.
|
||||
* @param how A code representing the type of comparison, as defined
|
||||
* above.
|
||||
* @param sourceRange The <code>Range</code> on which this current
|
||||
* <code>Range</code> is compared to.
|
||||
* @return -1, 0 or 1 depending on whether the corresponding
|
||||
* boundary-point of the Range is respectively before, equal to, or
|
||||
* after the corresponding boundary-point of <code>sourceRange</code>.
|
||||
* @exception DOMException
|
||||
* WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same
|
||||
* DOMDocument or DOMDocumentFragment.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual short compareBoundaryPoints(CompareHow how, const DOMRange* sourceRange) const = 0;
|
||||
|
||||
/**
|
||||
* Removes the contents of a Range from the containing document or
|
||||
* document fragment without returning a reference to the removed
|
||||
* content.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
|
||||
* the Range is read-only or any of the nodes that contain any of the
|
||||
* content of the Range are read-only.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void deleteContents() = 0;
|
||||
|
||||
/**
|
||||
* Moves the contents of a Range from the containing document or document
|
||||
* fragment to a new DOMDocumentFragment.
|
||||
* @return A DOMDocumentFragment containing the extracted contents.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
|
||||
* the Range is read-only or any of the nodes which contain any of the
|
||||
* content of the Range are read-only.
|
||||
* <br>HIERARCHY_REQUEST_ERR: Raised if a DOMDocumentType node would be
|
||||
* extracted into the new DOMDocumentFragment.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMDocumentFragment* extractContents() = 0;
|
||||
|
||||
/**
|
||||
* Duplicates the contents of a Range
|
||||
* @return A DOMDocumentFragment that contains content equivalent to this
|
||||
* Range.
|
||||
* @exception DOMException
|
||||
* HIERARCHY_REQUEST_ERR: Raised if a DOMDocumentType node would be
|
||||
* extracted into the new DOMDocumentFragment.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMDocumentFragment* cloneContents() const = 0;
|
||||
|
||||
/**
|
||||
* Inserts a node into the DOMDocument or DOMDocumentFragment at the start of
|
||||
* the Range. If the container is a DOMText node, this will be split at the
|
||||
* start of the Range (as if the DOMText node's splitText method was
|
||||
* performed at the insertion point) and the insertion will occur
|
||||
* between the two resulting DOMText nodes. Adjacent DOMText nodes will not be
|
||||
* automatically merged. If the node to be inserted is a
|
||||
* DOMDocumentFragment node, the children will be inserted rather than the
|
||||
* DOMDocumentFragment node itself.
|
||||
* @param newNode The node to insert at the start of the Range
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the
|
||||
* start of the Range is read-only.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and the
|
||||
* container of the start of the Range were not created from the same
|
||||
* document.
|
||||
* <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
|
||||
* the Range is of a type that does not allow children of the type of
|
||||
* <code>newNode</code> or if <code>newNode</code> is an ancestor of
|
||||
* the container.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
* @exception DOMRangeException
|
||||
* INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code> is an DOMAttr,
|
||||
* DOMEntity, DOMNotation, or DOMDocument node.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void insertNode(DOMNode *newNode) = 0;
|
||||
|
||||
/**
|
||||
* Reparents the contents of the Range to the given node and inserts the
|
||||
* node at the position of the start of the Range.
|
||||
* @param newParent The node to surround the contents with.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
|
||||
* either boundary-point of the Range is read-only.
|
||||
* <br>WRONG_DOCUMENT_ERR: Raised if <code> newParent</code> and the
|
||||
* container of the start of the Range were not created from the same
|
||||
* document.
|
||||
* <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
|
||||
* the Range is of a type that does not allow children of the type of
|
||||
* <code>newParent</code> or if <code>newParent</code> is an ancestor
|
||||
* of the container or if <code>node</code> would end up with a child
|
||||
* node of a type not allowed by the type of <code>node</code>.
|
||||
* <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
|
||||
* been invoked on this object.
|
||||
* @exception DOMRangeException
|
||||
* BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a
|
||||
* non-text node.
|
||||
* <br>INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is an DOMAttr,
|
||||
* DOMEntity, DOMDocumentType, DOMNotation, DOMDocument, or DOMDocumentFragment node.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void surroundContents(DOMNode *newParent) = 0;
|
||||
|
||||
/**
|
||||
* Produces a new Range whose boundary-points are equal to the
|
||||
* boundary-points of the Range.
|
||||
* @return The duplicated Range.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMRange* cloneRange() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the contents of a Range as a string. This string contains only
|
||||
* the data characters, not any markup.
|
||||
* @return The contents of the Range.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual const XMLCh* toString() const = 0;
|
||||
|
||||
/**
|
||||
* Called to indicate that the Range is no longer in use and that the
|
||||
* implementation may relinquish any resources associated with this
|
||||
* Range. Subsequent calls to any methods or attribute getters on this
|
||||
* Range will result in a <code>DOMException</code> being thrown with an
|
||||
* error code of <code>INVALID_STATE_ERR</code>.
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
|
||||
* invoked on this object.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void detach() = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this Range is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
* (release() will call detach() where appropriate)
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMRangeException.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMRANGEEXCEPTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMRANGEEXCEPTION_HPP
|
||||
|
||||
#include <xercesc/dom/DOMException.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* Range operations may throw a <code>DOMRangeException</code> as specified in
|
||||
* their method descriptions.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMRangeException : public DOMException {
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* Enumerators for DOM Range Exceptions
|
||||
*
|
||||
* <p><code>BAD_BOUNDARYPOINTS_ERR:</code>
|
||||
* If the boundary-points of a Range do not meet specific requirements.</p>
|
||||
*
|
||||
* <p><code>INVALID_NODE_TYPE_ERR:</code>
|
||||
* If the container of an boundary-point of a Range is being set to either
|
||||
* a node of an invalid type or a node with an ancestor of an invalid
|
||||
* type.</p>
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
enum RangeExceptionCode {
|
||||
BAD_BOUNDARYPOINTS_ERR = 111,
|
||||
INVALID_NODE_TYPE_ERR = 112
|
||||
};
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Constructors */
|
||||
//@{
|
||||
/**
|
||||
* Default constructor for DOMRangeException.
|
||||
*
|
||||
*/
|
||||
DOMRangeException();
|
||||
|
||||
/**
|
||||
* Constructor which takes an error code and a message.
|
||||
*
|
||||
* @param code The error code which indicates the exception
|
||||
* @param messageCode The string containing the error message
|
||||
* @param memoryManager The memory manager used to (de)allocate memory
|
||||
*/
|
||||
DOMRangeException(short code,
|
||||
short messageCode,
|
||||
MemoryManager* const memoryManager);
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*
|
||||
* @param other The object to be copied.
|
||||
*/
|
||||
DOMRangeException(const DOMRangeException &other);
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Destructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor. */
|
||||
//@{
|
||||
/**
|
||||
* Destructor for DOMRangeException.
|
||||
*
|
||||
*/
|
||||
virtual ~DOMRangeException();
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMRangeException & operator = (const DOMRangeException &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMStringList.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGLIST_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMSTRINGLIST_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMStringList</code> interface provides the abstraction of an ordered
|
||||
* collection of strings, without defining or constraining how this collection
|
||||
* is implemented. The items in the <code>DOMStringList</code> are accessible via
|
||||
* an integral index, starting from 0.
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMStringList {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMStringList() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMStringList(const DOMStringList &);
|
||||
DOMStringList & operator = (const DOMStringList &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMStringList() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMStringList interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns the <code>index</code> item in the collection.
|
||||
*
|
||||
* If <code>index</code> is greater than or equal to the number of strings in
|
||||
* the list, this returns <code>null</code>.
|
||||
*
|
||||
* @param index Index into the collection.
|
||||
* @return The string at the <code>index</code>th position in the
|
||||
* <code>DOMStringList</code>, or <code>null</code> if that is not a valid
|
||||
* index.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh *item(XMLSize_t index) const = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of strings in the list.
|
||||
*
|
||||
* The range of valid child node indices is 0 to <code>length-1</code> inclusive.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual XMLSize_t getLength() const = 0;
|
||||
|
||||
/**
|
||||
* Test if a string is part of this DOMStringList
|
||||
*
|
||||
* @return <code>true</code> if the string has been found, <code>false</code> otherwise.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool contains(const XMLCh*) const = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this list is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it and
|
||||
* its associated children.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMText.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTEXT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTEXT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMCharacterData.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DOMText</code> interface inherits from <code>DOMCharacterData</code>
|
||||
* and represents the textual content (termed character data in XML) of an
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code>. If there is no markup inside
|
||||
* an element's content, the text is contained in a single object
|
||||
* implementing the <code>DOMText</code> interface that is the only child of
|
||||
* the element. If there is markup, it is parsed into the information items
|
||||
* (elements, comments, etc.) and <code>DOMText</code> nodes that form the list
|
||||
* of children of the element.
|
||||
* <p>When a document is first made available via the DOM, there is only one
|
||||
* <code>DOMText</code> node for each block of text. Users may create adjacent
|
||||
* <code>DOMText</code> nodes that represent the contents of a given element
|
||||
* without any intervening markup, but should be aware that there is no way
|
||||
* to represent the separations between these nodes in XML or HTML, so they
|
||||
* will not (in general) persist between DOM editing sessions. The
|
||||
* <code>normalize()</code> method on <code>DOMNode</code> merges any such
|
||||
* adjacent <code>DOMText</code> objects into a single node for each block of
|
||||
* text.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
||||
*/
|
||||
class CDOM_EXPORT DOMText: public DOMCharacterData {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMText() {}
|
||||
DOMText(const DOMText &other) : DOMCharacterData(other) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented operators */
|
||||
//@{
|
||||
DOMText & operator = (const DOMText &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMText() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMText interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 1 */
|
||||
//@{
|
||||
/**
|
||||
* Breaks this node into two nodes at the specified <code>offset</code>,
|
||||
* keeping both in the tree as siblings. After being split, this node
|
||||
* will contain all the content up to the <code>offset</code> point. A
|
||||
* new node of the same type, which contains all the content at and
|
||||
* after the <code>offset</code> point, is returned. If the original
|
||||
* node had a parent node, the new node is inserted as the next sibling
|
||||
* of the original node. When the <code>offset</code> is equal to the
|
||||
* length of this node, the new node has no data.
|
||||
* @param offset The 16-bit unit offset at which to split, starting from
|
||||
* <code>0</code>.
|
||||
* @return The new node, of the same type as this node.
|
||||
* @exception DOMException
|
||||
* INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
|
||||
* than the number of 16-bit units in <code>data</code>.
|
||||
* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
|
||||
* @since DOM Level 1
|
||||
*/
|
||||
virtual DOMText *splitText(XMLSize_t offset) = 0;
|
||||
//@}
|
||||
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* Returns whether this text node contains element content whitespace,
|
||||
* often abusively called "ignorable whitespace". The text node is determined
|
||||
* to contain whitespace in element content during the load of the document
|
||||
* or if validation occurs while using <code>DOMDocument::normalizeDocument()</code>.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual bool getIsElementContentWhitespace() const = 0;
|
||||
|
||||
/**
|
||||
* Returns all text of <code>DOMText</code> nodes logically-adjacent text
|
||||
* nodes to this node, concatenated in document order.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual const XMLCh* getWholeText() const = 0;
|
||||
|
||||
/**
|
||||
* Substitutes the a specified text for the text of the current node and
|
||||
* all logically-adjacent text nodes.
|
||||
*
|
||||
* <br>This method returns the node in the hierarchy which received the
|
||||
* replacement text, which is null if the text was empty or is the
|
||||
* current node if the current node is not read-only or otherwise is a
|
||||
* new node of the same type as the current node inserted at the site of
|
||||
* the replacement. All logically-adjacent text nodes are removed
|
||||
* including the current node unless it was the recipient of the
|
||||
* replacement text.
|
||||
* <br>Where the nodes to be removed are read-only descendants of an
|
||||
* <code>DOMEntityReference</code>, the <code>DOMEntityReference</code> must
|
||||
* be removed instead of the read-only nodes. If any
|
||||
* <code>DOMEntityReference</code> to be removed has descendants that are
|
||||
* not <code>DOMEntityReference</code>, <code>DOMText</code>, or
|
||||
* <code>DOMCDATASection</code> nodes, the <code>replaceWholeText</code>
|
||||
* method must fail before performing any modification of the document,
|
||||
* raising a <code>DOMException</code> with the code
|
||||
* <code>NO_MODIFICATION_ALLOWED_ERR</code>.
|
||||
*
|
||||
* @param content The content of the replacing <code>DOMText</code> node.
|
||||
* @return The <code>DOMText</code> node created with the specified content.
|
||||
* @exception DOMException
|
||||
* NO_MODIFICATION_ALLOWED_ERR: Raised if one of the <code>DOMText</code>
|
||||
* nodes being replaced is readonly.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMText* replaceWholeText(const XMLCh* content) = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard extension */
|
||||
//@{
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Return true if this node contains ignorable whitespaces only.
|
||||
* @return True if this node contains ignorable whitespaces only.
|
||||
*/
|
||||
virtual bool isIgnorableWhitespace() const = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMTreeWalker.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTREEWALKER_HPP
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMNodeFilter.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* <code>DOMTreeWalker</code> objects are used to navigate a document tree or
|
||||
* subtree using the view of the document defined by their
|
||||
* <code>whatToShow</code> flags and filter (if any). Any function which
|
||||
* performs navigation using a <code>DOMTreeWalker</code> will automatically
|
||||
* support any view defined by a <code>DOMTreeWalker</code>.
|
||||
* <p>Omitting nodes from the logical view of a subtree can result in a
|
||||
* structure that is substantially different from the same subtree in the
|
||||
* complete, unfiltered document. Nodes that are siblings in the
|
||||
* <code>DOMTreeWalker</code> view may be children of different, widely
|
||||
* separated nodes in the original view. For instance, consider a
|
||||
* <code>DOMNodeFilter</code> that skips all nodes except for DOMText nodes and
|
||||
* the root node of a document. In the logical view that results, all text
|
||||
* nodes will be siblings and appear as direct children of the root node, no
|
||||
* matter how deeply nested the structure of the original document.
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
class CDOM_EXPORT DOMTreeWalker {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMTreeWalker() {}
|
||||
DOMTreeWalker(const DOMTreeWalker &) {}
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMTreeWalker & operator = (const DOMTreeWalker &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMTreeWalker() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMTreeWalker interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 2 */
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The <code>root</code> node of the <code>DOMTreeWalker</code>, as specified
|
||||
* when it was created.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* getRoot() = 0;
|
||||
/**
|
||||
* This attribute determines which node types are presented via the
|
||||
* <code>DOMTreeWalker</code>. The available set of constants is defined in
|
||||
* the <code>DOMNodeFilter</code> interface. Nodes not accepted by
|
||||
* <code>whatToShow</code> will be skipped, but their children may still
|
||||
* be considered. Note that this skip takes precedence over the filter,
|
||||
* if any.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNodeFilter::ShowType getWhatToShow()= 0;
|
||||
|
||||
/**
|
||||
* Return The filter used to screen nodes.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNodeFilter* getFilter()= 0;
|
||||
|
||||
/**
|
||||
* The value of this flag determines whether the children of entity
|
||||
* reference nodes are visible to the <code>DOMTreeWalker</code>. If false,
|
||||
* these children and their descendants will be rejected. Note that
|
||||
* this rejection takes precedence over <code>whatToShow</code> and the
|
||||
* filter, if any.
|
||||
* <br> To produce a view of the document that has entity references
|
||||
* expanded and does not expose the entity reference node itself, use
|
||||
* the <code>whatToShow</code> flags to hide the entity reference node
|
||||
* and set <code>expandEntityReferences</code> to true when creating the
|
||||
* <code>DOMTreeWalker</code>. To produce a view of the document that has
|
||||
* entity reference nodes but no entity expansion, use the
|
||||
* <code>whatToShow</code> flags to show the entity reference node and
|
||||
* set <code>expandEntityReferences</code> to false.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual bool getExpandEntityReferences()= 0;
|
||||
|
||||
/**
|
||||
* Return the node at which the DOMTreeWalker is currently positioned.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* getCurrentNode()= 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Query methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Moves to and returns the closest visible ancestor node of the current
|
||||
* node. If the search for <code>parentNode</code> attempts to step
|
||||
* upward from the <code>DOMTreeWalker</code>'s <code>root</code> node, or
|
||||
* if it fails to find a visible ancestor node, this method retains the
|
||||
* current position and returns <code>null</code>.
|
||||
* @return The new parent node, or <code>null</code> if the current node
|
||||
* has no parent in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* parentNode()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the first visible child of the
|
||||
* current node, and returns the new node. If the current node has no
|
||||
* visible children, returns <code>null</code>, and retains the current
|
||||
* node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* visible children in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* firstChild()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the last visible child of the
|
||||
* current node, and returns the new node. If the current node has no
|
||||
* visible children, returns <code>null</code>, and retains the current
|
||||
* node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* children in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* lastChild()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the previous sibling of the
|
||||
* current node, and returns the new node. If the current node has no
|
||||
* visible previous sibling, returns <code>null</code>, and retains the
|
||||
* current node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* previous sibling. in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* previousSibling()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the next sibling of the current
|
||||
* node, and returns the new node. If the current node has no visible
|
||||
* next sibling, returns <code>null</code>, and retains the current node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* next sibling. in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* nextSibling()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the previous visible node in
|
||||
* document order relative to the current node, and returns the new
|
||||
* node. If the current node has no previous node, or if the search for
|
||||
* <code>previousNode</code> attempts to step upward from the
|
||||
* <code>DOMTreeWalker</code>'s <code>root</code> node, returns
|
||||
* <code>null</code>, and retains the current node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* previous node in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* previousNode()= 0;
|
||||
|
||||
/**
|
||||
* Moves the <code>DOMTreeWalker</code> to the next visible node in document
|
||||
* order relative to the current node, and returns the new node. If the
|
||||
* current node has no next node, or if the search for nextNode attempts
|
||||
* to step upward from the <code>DOMTreeWalker</code>'s <code>root</code>
|
||||
* node, returns <code>null</code>, and retains the current node.
|
||||
* @return The new node, or <code>null</code> if the current node has no
|
||||
* next node in the <code>DOMTreeWalker</code>'s logical view.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual DOMNode* nextNode()= 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The node at which the <code>DOMTreeWalker</code> is currently positioned.
|
||||
* <br>Alterations to the DOM tree may cause the current node to no longer
|
||||
* be accepted by the <code>DOMTreeWalker</code>'s associated filter.
|
||||
* <code>currentNode</code> may also be explicitly set to any node,
|
||||
* whether or not it is within the subtree specified by the
|
||||
* <code>root</code> node or would be accepted by the filter and
|
||||
* <code>whatToShow</code> flags. Further traversal occurs relative to
|
||||
* <code>currentNode</code> even if it is not part of the current view,
|
||||
* by applying the filters in the requested direction; if no traversal
|
||||
* is possible, <code>currentNode</code> is not changed.
|
||||
* @exception DOMException
|
||||
* NOT_SUPPORTED_ERR: Raised if an attempt is made to set
|
||||
* <code>currentNode</code> to <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 2
|
||||
*/
|
||||
virtual void setCurrentNode(DOMNode* currentNode)= 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this TreeWalker is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
#define GetDOMTreeWalkerMemoryManager GET_INDIRECT_MM(fCurrentNode)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* The <code>DOMTypeInfo</code> interface represent a type used by
|
||||
* <code>DOMElement</code> or <code>DOMAttr</code> nodes, specified in the
|
||||
* schemas associated with the document. The type is a pair of a namespace URI
|
||||
* and name properties, and depends on the document's schema.
|
||||
*/
|
||||
class CDOM_EXPORT DOMTypeInfo
|
||||
{
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMTypeInfo() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMTypeInfo(const DOMTypeInfo &);
|
||||
DOMTypeInfo & operator = (const DOMTypeInfo &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMTypeInfo() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Contants */
|
||||
//@{
|
||||
/**
|
||||
* These are the available values for the derivationMethod parameter used by the
|
||||
* method <code>DOMTypeInfo::isDerivedFrom()</code>. It is a set of possible types
|
||||
* of derivation, and the values represent bit positions. If a bit in the derivationMethod
|
||||
* parameter is set to 1, the corresponding type of derivation will be taken into account
|
||||
* when evaluating the derivation between the reference type definition and the other type
|
||||
* definition. When using the isDerivedFrom method, combining all of them in the
|
||||
* derivationMethod parameter is equivalent to invoking the method for each of them separately
|
||||
* and combining the results with the OR boolean function. This specification only defines
|
||||
* the type of derivation for XML Schema.
|
||||
*
|
||||
* In addition to the types of derivation listed below, please note that:
|
||||
* - any type derives from xsd:anyType.
|
||||
* - any simple type derives from xsd:anySimpleType by restriction.
|
||||
* - any complex type does not derive from xsd:anySimpleType by restriction.
|
||||
*
|
||||
* <p><code>DERIVATION_EXTENSION:</code>
|
||||
* If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the
|
||||
* derivation by extension. The reference type definition is derived by extension from the other
|
||||
* type definition if the other type definition can be reached recursively following the
|
||||
* {base type definition} property from the reference type definition, and at least one of the
|
||||
* derivation methods involved is an extension.</p>
|
||||
*
|
||||
* <p><code>DERIVATION_LIST:</code>
|
||||
* If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the list.
|
||||
* The reference type definition is derived by list from the other type definition if there exists
|
||||
* two type definitions T1 and T2 such as the reference type definition is derived from T1 by
|
||||
* DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by
|
||||
* DERIVATION_RESTRICTION, T1 has {variety} list, and T2 is the {item type definition}. Note that
|
||||
* T1 could be the same as the reference type definition, and T2 could be the same as the other
|
||||
* type definition.</p>
|
||||
*
|
||||
* <p><code>DERIVATION_RESTRICTION:</code>
|
||||
* If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the
|
||||
* derivation by restriction if complex types are involved, or a restriction if simple types are
|
||||
* involved.
|
||||
* The reference type definition is derived by restriction from the other type definition if the
|
||||
* other type definition is the same as the reference type definition, or if the other type definition
|
||||
* can be reached recursively following the {base type definition} property from the reference type
|
||||
* definition, and all the derivation methods involved are restriction.</p>
|
||||
*
|
||||
* <p><code>DERIVATION_UNION:</code>
|
||||
* If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the union
|
||||
* if simple types are involved.
|
||||
* The reference type definition is derived by union from the other type definition if there exists
|
||||
* two type definitions T1 and T2 such as the reference type definition is derived from T1 by
|
||||
* DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by
|
||||
* DERIVATION_RESTRICTION, T1 has {variety} union, and one of the {member type definitions} is T2.
|
||||
* Note that T1 could be the same as the reference type definition, and T2 could be the same as the
|
||||
* other type definition.</p>
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*
|
||||
*/
|
||||
enum DerivationMethods {
|
||||
DERIVATION_RESTRICTION = 0x001,
|
||||
DERIVATION_EXTENSION = 0x002,
|
||||
DERIVATION_UNION = 0x004,
|
||||
DERIVATION_LIST = 0x008
|
||||
};
|
||||
//@}
|
||||
|
||||
//@{
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns The name of a type declared for the associated <code>DOMElement</code>
|
||||
* or <code>DOMAttr</code>, or null if unknown.
|
||||
*
|
||||
* @return The name of a type declared for the associated <code>DOMElement</code>
|
||||
* or <code>DOMAttribute</code>, or null if unknown.
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual const XMLCh* getTypeName() const = 0;
|
||||
|
||||
/**
|
||||
* The namespace of the type declared for the associated <code>DOMElement</code>
|
||||
* or <code>DOMAttr</code> or null if the <code>DOMElement</code> does not have
|
||||
* declaration or if no namespace information is available.
|
||||
*
|
||||
* @return The namespace of the type declared for the associated <code>DOMElement</code>
|
||||
* or <code>DOMAttr</code> or null if the <code>DOMElement</code> does not have
|
||||
* declaration or if no namespace information is available.
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual const XMLCh* getTypeNamespace() const = 0;
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* This method returns if there is a derivation between the reference type definition,
|
||||
* i.e. the DOMTypeInfo on which the method is being called, and the other type definition,
|
||||
* i.e. the one passed as parameters.
|
||||
*
|
||||
* @param typeNamespaceArg The namespace of the other type definition.
|
||||
* @param typeNameArg The name of the other type definition.
|
||||
* @param derivationMethod The type of derivation and conditions applied between two types,
|
||||
* as described in the list of constants provided in this interface.
|
||||
* @return If the document's schema is a DTD or no schema is associated with the document,
|
||||
* this method will always return false.
|
||||
* If the document's schema is an XML Schema, the method will true if the reference
|
||||
* type definition is derived from the other type definition according to the derivation
|
||||
* parameter. If the value of the parameter is 0 (no bit is set to 1 for the
|
||||
* derivationMethod parameter), the method will return true if the other type definition
|
||||
* can be reached by recursing any combination of {base type definition},
|
||||
* {item type definition}, or {member type definitions} from the reference type definition.
|
||||
* @since DOM level 3
|
||||
*/
|
||||
virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg,
|
||||
const XMLCh* typeNameArg,
|
||||
DerivationMethods derivationMethod) const = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMTypeInfo.hpp
|
||||
*/
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMUserDataHandler.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMUSERDATAHANDLER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMUSERDATAHANDLER_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* When associating an object to a key on a node using <code>setUserData</code>
|
||||
* the application can provide a handler that gets called when the node the
|
||||
* object is associated to is being cloned or imported. This can be used by
|
||||
* the application to implement various behaviors regarding the data it
|
||||
* associates to the DOM nodes. This interface defines that handler.
|
||||
*
|
||||
* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMUserDataHandler {
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMUserDataHandler() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMUserDataHandler(const DOMUserDataHandler &);
|
||||
DOMUserDataHandler & operator = (const DOMUserDataHandler &);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMUserDataHandler() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* Operation Type
|
||||
*
|
||||
* <p><code>NODE_CLONED:</code>
|
||||
* The node is cloned.</p>
|
||||
*
|
||||
* <p><code>NODE_IMPORTED</code>
|
||||
* The node is imported.</p>
|
||||
*
|
||||
* <p><code>NODE_DELETED</code>
|
||||
* The node is deleted.</p>
|
||||
*
|
||||
* <p><code>NODE_RENAMED</code>
|
||||
* The node is renamed.
|
||||
*
|
||||
* <p><code>NODE_ADOPTED</code>
|
||||
* The node is adopted.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
enum DOMOperationType {
|
||||
NODE_CLONED = 1,
|
||||
NODE_IMPORTED = 2,
|
||||
NODE_DELETED = 3,
|
||||
NODE_RENAMED = 4,
|
||||
NODE_ADOPTED = 5
|
||||
};
|
||||
//@}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMUserDataHandler interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* This method is called whenever the node for which this handler is
|
||||
* registered is imported or cloned.
|
||||
*
|
||||
* @param operation Specifies the type of operation that is being
|
||||
* performed on the node.
|
||||
* @param key Specifies the key for which this handler is being called.
|
||||
* @param data Specifies the data for which this handler is being called.
|
||||
* @param src Specifies the node being cloned, adopted, imported, or renamed.
|
||||
* This is <code>null</code> when the node is being deleted.
|
||||
* @param dst Specifies the node newly created if any, or <code>null</code>.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual void handle(DOMOperationType operation,
|
||||
const XMLCh* const key,
|
||||
void* data,
|
||||
const DOMNode* src,
|
||||
DOMNode* dst) = 0;
|
||||
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathEvaluator.hpp 698579 2008-09-24 14:13:08Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEVALUATOR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHEVALUATOR_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMXPathResult.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMXPathNSResolver;
|
||||
class DOMXPathExpression;
|
||||
class DOMNode;
|
||||
|
||||
/**
|
||||
* The evaluation of XPath expressions is provided by <code>DOMXPathEvaluator</code>.
|
||||
* In a DOM implementation which supports the XPath feature, the <code>DOMXPathEvaluator</code>
|
||||
* interface will be implemented on the same object which implements the Document interface permitting
|
||||
* it to be obtained by casting or by using the DOM Level 3 getFeature method. In this case the
|
||||
* implementation obtained from the Document supports the XPath DOM module and is compatible
|
||||
* with the XPath 1.0 specification.
|
||||
* Evaluation of expressions with specialized extension functions or variables may not
|
||||
* work in all implementations and is, therefore, not portable. XPathEvaluator implementations
|
||||
* may be available from other sources that could provide specific support for specialized extension
|
||||
* functions or variables as would be defined by other specifications.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathEvaluator
|
||||
{
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMXPathEvaluator() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMXPathEvaluator(const DOMXPathEvaluator &);
|
||||
DOMXPathEvaluator& operator = (const DOMXPathEvaluator&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathEvaluator() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMXPathEvaluator interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Creates a parsed XPath expression with resolved namespaces. This is useful
|
||||
* when an expression will be reused in an application since it makes it
|
||||
* possible to compile the expression string into a more efficient internal
|
||||
* form and preresolve all namespace prefixes which occur within the expression.
|
||||
* @param expression of type XMLCh - The XPath expression string to be parsed.
|
||||
* @param resolver of type <code>XPathNSResolver</code> - The resolver permits
|
||||
* translation of all prefixes, including the xml namespace prefix, within the XPath expression
|
||||
* into appropriate namespace URIs. If this is specified as null, any namespace
|
||||
* prefix within the expression will result in <code>DOMException</code> being thrown with the
|
||||
* code NAMESPACE_ERR.
|
||||
* @return <code>DOMXPathExpression</code> The compiled form of the XPath expression.
|
||||
* @exception <code>DOMXPathException</code>
|
||||
* INVALID_EXPRESSION_ERR: Raised if the expression is not legal according to the
|
||||
* rules of the <code>DOMXPathEvaluator</code>.
|
||||
* @exception DOMException
|
||||
* NAMESPACE_ERR: Raised if the expression contains namespace prefixes which cannot
|
||||
* be resolved by the specified <code>XPathNSResolver</code>.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMXPathExpression* createExpression(const XMLCh *expression,
|
||||
const DOMXPathNSResolver *resolver) = 0;
|
||||
|
||||
|
||||
/** Adapts any DOM node to resolve namespaces so that an XPath expression can be
|
||||
* easily evaluated relative to the context of the node where it appeared within
|
||||
* the document. This adapter works like the DOM Level 3 method lookupNamespaceURI
|
||||
* on nodes in resolving the namespaceURI from a given prefix using the current
|
||||
* information available in the node's hierarchy at the time lookupNamespaceURI
|
||||
* is called. also correctly resolving the implicit xml prefix.
|
||||
* @param nodeResolver of type <code>DOMNode</code> The node to be used as a context
|
||||
* for namespace resolution. If this parameter is null, an unpopulated
|
||||
* <code>DOMXPathNSResolver</code> is returned, which can be populated using the
|
||||
* Xerces-C extension <code>DOMXPathNSResolver::addNamespaceBinding()</code>.
|
||||
* @return <code>DOMXPathNSResolver</code> The object which resolves namespaces
|
||||
* with respect to the definitions in scope for the specified node.
|
||||
*/
|
||||
virtual DOMXPathNSResolver* createNSResolver(const DOMNode *nodeResolver) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Evaluates an XPath expression string and returns a result of the specified
|
||||
* type if possible.
|
||||
* @param expression of type XMLCh The XPath expression string to be parsed
|
||||
* and evaluated.
|
||||
* @param contextNode of type <code>DOMNode</code> The context is context node
|
||||
* for the evaluation
|
||||
* of this XPath expression. If the <code>DOMXPathEvaluator</code> was obtained by
|
||||
* casting the <code>DOMDocument</code> then this must be owned by the same
|
||||
* document and must be a <code>DOMDocument</code>, <code>DOMElement</code>,
|
||||
* <code>DOMAttribute</code>, <code>DOMText</code>, <code>DOMCDATASection</code>,
|
||||
* <code>DOMComment</code>, <code>DOMProcessingInstruction</code>, or
|
||||
* <code>XPathNamespace</code> node. If the context node is a <code>DOMText</code> or
|
||||
* a <code>DOMCDATASection</code>, then the context is interpreted as the whole
|
||||
* logical text node as seen by XPath, unless the node is empty in which case it
|
||||
* may not serve as the XPath context.
|
||||
* @param resolver of type <code>XPathNSResolver</code> The resolver permits
|
||||
* translation of all prefixes, including the xml namespace prefix, within
|
||||
* the XPath expression into appropriate namespace URIs. If this is specified
|
||||
* as null, any namespace prefix within the expression will result in
|
||||
* <code>DOMException</code> being thrown with the code NAMESPACE_ERR.
|
||||
* @param type - If a specific type is specified, then
|
||||
* the result will be returned as the corresponding type. This must be one
|
||||
* of the codes of the <code>DOMXPathResult</code> interface.
|
||||
* @param result of type DOMXPathResult* - The result specifies a specific result object
|
||||
* which may be reused and returned by this method. If this is specified as
|
||||
* null or the implementation does not reuse the specified result, a new result
|
||||
* object will be constructed and returned.
|
||||
* @return DOMXPathResult* The result of the evaluation of the XPath expression.
|
||||
* @exception <code>DOMXPathException</code>
|
||||
* INVALID_EXPRESSION_ERR: Raised if the expression is not legal
|
||||
* according to the rules of the <code>DOMXPathEvaluator</code>
|
||||
* TYPE_ERR: Raised if the result cannot be converted to return the specified type.
|
||||
* @exception <code>DOMException</code>
|
||||
* NAMESPACE_ERR: Raised if the expression contains namespace prefixes
|
||||
* which cannot be resolved by the specified <code>XPathNSResolver</code>.
|
||||
* WRONG_DOCUMENT_ERR: The DOMNode is from a document that is not supported
|
||||
* by this <code>DOMXPathEvaluator</code>.
|
||||
* NOT_SUPPORTED_ERR: The DOMNode is not a type permitted as an XPath context
|
||||
* node or the request type is not permitted by this <code>DOMXPathEvaluator</code>.
|
||||
*/
|
||||
virtual DOMXPathResult* evaluate(const XMLCh *expression,
|
||||
const DOMNode *contextNode,
|
||||
const DOMXPathNSResolver *resolver,
|
||||
DOMXPathResult::ResultType type,
|
||||
DOMXPathResult* result) = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathException.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXCEPTION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHEXCEPTION_HPP
|
||||
|
||||
#include <xercesc/dom/DOMException.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathException : public DOMException
|
||||
{
|
||||
public:
|
||||
//@{
|
||||
/**
|
||||
* ExceptionCode
|
||||
* <br>INVALID_EXPRESSION_ERR The expression has a syntax error or otherwise
|
||||
* is not a legal expression according to the rules of the specific
|
||||
* <code>DOMXPathEvaluator</code> or contains specialized extension functions
|
||||
* or variables not supported by this implementation.
|
||||
* <br>TYPE_ERR The expression cannot be converted to return the specified type.
|
||||
* <br>NO_RESULT_ERROR There is no current result in the result object.
|
||||
*/
|
||||
enum ExceptionCode {
|
||||
INVALID_EXPRESSION_ERR = 51,
|
||||
TYPE_ERR = 52,
|
||||
NO_RESULT_ERROR = 53
|
||||
};
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Constructors */
|
||||
//@{
|
||||
/**
|
||||
* Default constructor for DOMXPathException.
|
||||
*
|
||||
*/
|
||||
DOMXPathException();
|
||||
|
||||
/**
|
||||
* Constructor which takes an error code and a message.
|
||||
*
|
||||
* @param code The error code which indicates the exception
|
||||
* @param messageCode The string containing the error message
|
||||
* @param memoryManager The memory manager used to (de)allocate memory
|
||||
*/
|
||||
DOMXPathException(short code,
|
||||
short messageCode = 0,
|
||||
MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*
|
||||
* @param other The object to be copied.
|
||||
*/
|
||||
DOMXPathException(const DOMXPathException &other);
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Destructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor. */
|
||||
//@{
|
||||
/**
|
||||
* Destructor for DOMXPathException.
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathException();
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMXPathException& operator = (const DOMXPathException&);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathExpression.hpp 698579 2008-09-24 14:13:08Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMXPathResult.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMNode;
|
||||
|
||||
/**
|
||||
* The <code>DOMXPathExpression</code> interface represents a parsed and resolved XPath expression.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathExpression
|
||||
{
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMXPathExpression() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMXPathExpression(const DOMXPathExpression &);
|
||||
DOMXPathExpression& operator = (const DOMXPathExpression&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathExpression() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMXPathExpression interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Evaluates this XPath expression and returns a result.
|
||||
* @param contextNode of type <code>DOMNode</code> The context is context
|
||||
* node for the evaluation of this XPath expression.
|
||||
* If the XPathEvaluator was obtained by casting the Document then this must
|
||||
* be owned by the same document and must be a <code>DOMDocument</code>, <code>DOMElement</code>,
|
||||
* <code>DOMAttribute</code>, <code>DOMText</code>, <code>DOMCDATASection</code>,
|
||||
* <code>DOMComment</code>, <code>DOMProcessingInstruction</code>, or
|
||||
* <code>XPathNamespace</code>. If the context node is a <code>DOMText</code> or a
|
||||
* <code>DOMCDATASection</code>, then the context is interpreted as the whole logical
|
||||
* text node as seen by XPath, unless the node is empty in which case it may not
|
||||
* serve as the XPath context.
|
||||
* @param type If a specific type is specified, then the result
|
||||
* will be coerced to return the specified type relying on XPath conversions and fail
|
||||
* if the desired coercion is not possible. This must be one of the type codes of <code>DOMXPathResult</code>.
|
||||
* @param result of type DOMXPathResult* The result specifies a specific result object which
|
||||
* may be reused and returned by this method. If this is specified as nullor the
|
||||
* implementation does not reuse the specified result, a new result object will be constructed
|
||||
* and returned.
|
||||
* @return DOMXPathResult* The result of the evaluation of the XPath expression.
|
||||
* @exception <code>DOMXPathException</code>
|
||||
* TYPE_ERR: Raised if the result cannot be converted to return the specified type.
|
||||
* @exception <code>DOMException</code>
|
||||
* WRONG_DOCUMENT_ERR: The <code>DOMNode</code> is from a document that is not supported by
|
||||
* the <code>XPathEvaluator</code> that created this <code>DOMXPathExpression</code>.
|
||||
* NOT_SUPPORTED_ERR: The DOMNode is not a type permitted as an XPath context node or the
|
||||
* request type is not permitted by this <code>DOMXPathExpression</code>.
|
||||
*/
|
||||
|
||||
virtual DOMXPathResult* evaluate(const DOMNode *contextNode,
|
||||
DOMXPathResult::ResultType type,
|
||||
DOMXPathResult* result) const = 0;
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this DOMXPathExpression is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathNSResolver.hpp 698579 2008-09-24 14:13:08Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVER_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
/**
|
||||
* The <code>DOMXPathNSResolver</code> interface permit prefix strings
|
||||
* in the expression to be properly bound to namespaceURI strings.
|
||||
* <code>DOMXPathEvaluator</code> can construct an implementation of
|
||||
* <code>DOMXPathNSResolver</code> from a node, or the interface may be
|
||||
* implemented by any application.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathNSResolver
|
||||
{
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMXPathNSResolver() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMXPathNSResolver(const DOMXPathNSResolver &);
|
||||
DOMXPathNSResolver& operator = (const DOMXPathNSResolver&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathNSResolver() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMDocument interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
/** Look up the namespace URI associated to the given namespace prefix.
|
||||
*
|
||||
* @param prefix of type XMLCh - The prefix to look for. An empty or
|
||||
* null string denotes the default namespace.
|
||||
* @return the associated namespace URI or null if none is found.
|
||||
*/
|
||||
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const = 0;
|
||||
//@}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard extension */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* XPath2 implementations require a reverse lookup in the static context.
|
||||
* Look up the prefix associated with the namespace URI
|
||||
* @param URI of type XMLCh - The namespace to look for.
|
||||
* @return the associated prefix which can be an empty string if this
|
||||
* is a default namespace or null if none is found.
|
||||
*/
|
||||
virtual const XMLCh* lookupPrefix(const XMLCh* URI) const = 0;
|
||||
|
||||
/**
|
||||
* Non-standard extension
|
||||
*
|
||||
* Associate the given namespace prefix to the namespace URI.
|
||||
* @param prefix of type XMLCh - The namespace prefix to bind. An empty
|
||||
* or null string denotes the default namespace.
|
||||
* @param uri of type XMLCh - The associated namespace URI. If this
|
||||
* argument is null or an empty string then the existing binding for this
|
||||
* prefix is removed.
|
||||
*/
|
||||
virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri) = 0;
|
||||
|
||||
/**
|
||||
* Called to indicate that this object (and its associated children) is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it and
|
||||
* its associated children.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathNamespace.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNAMESPACE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHNAMESPACE_HPP
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMElement;
|
||||
|
||||
/**
|
||||
* The <code>DOMXPathNamespace</code> interface is returned by <code>DOMXPathResult</code>
|
||||
* interfaces to represent the XPath namespace node type that DOM lacks. There is no
|
||||
* public constructor for this node type. Attempts to place it into a hierarchy or a
|
||||
* NamedNodeMap result in a DOMException with the code HIERARCHY_REQUEST_ERR. This node
|
||||
* is read only, so methods or setting of attributes that would mutate the node result
|
||||
* in a <code>DOMException</code> with the code NO_MODIFICATION_ALLOWED_ERR.
|
||||
* The core specification describes attributes of the <code>DOMNode</code> interface that
|
||||
* are different for different node types but does not describe XPATH_NAMESPACE_NODE,
|
||||
* so here is a description of those attributes for this node type. All attributes of
|
||||
* <code>DOMNode</code> not described in this section have a null or false value.
|
||||
* ownerDocument matches the ownerDocument of the ownerElement even if the element is later adopted.
|
||||
* nodeName is always the string "#namespace".
|
||||
* prefix is the prefix of the namespace represented by the node.
|
||||
* localName is the same as prefix.
|
||||
* nodeType is equal to XPATH_NAMESPACE_NODE.
|
||||
* namespaceURI is the namespace URI of the namespace represented by the node.
|
||||
* nodeValue is the same as namespaceURI.
|
||||
* adoptNode, cloneNode, and importNode fail on this node type by raising a DOMException with the code NOT_SUPPORTED_ERR.
|
||||
* Note: In future versions of the XPath specification, the definition of a namespace node may
|
||||
* be changed incompatibly, in which case incompatible changes to field values may be required to
|
||||
* implement versions beyond XPath 1.0.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathNamespace : public DOMNode
|
||||
{
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMXPathNamespace() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMXPathNamespace(const DOMXPathNamespace &);
|
||||
DOMXPathNamespace& operator = (const DOMXPathNamespace&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
enum XPathNodeType {
|
||||
XPATH_NAMESPACE_NODE = 13
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathNamespace() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMXPathNamespace interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
/**
|
||||
* The <code>DOMElement</code> on which the namespace was in scope when
|
||||
* it was requested. This does not change on a returned namespace node
|
||||
* even if the document changes such that the namespace goes out of
|
||||
* scope on that element and this node is no longer found there by XPath.
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
virtual DOMElement *getOwnerElement() const = 0;
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,351 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathResult.hpp 932887 2010-04-11 13:04:59Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULT_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHRESULT_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMXPathNSResolver;
|
||||
class DOMXPathExpression;
|
||||
class DOMTypeInfo;
|
||||
class DOMNode;
|
||||
|
||||
/**
|
||||
* The <code>DOMXPathResult</code> interface represents the result of the
|
||||
* evaluation of an XPath 1.0 or XPath 2.0 expression within the context
|
||||
* of a particular node. Since evaluation of an XPath expression can result
|
||||
* in various result types, this object makes it possible to discover and
|
||||
* manipulate the type and value of the result.
|
||||
*
|
||||
* Note that some function signatures were changed compared to the
|
||||
* DOM Level 3 in order to accommodate XPath 2.0.
|
||||
*
|
||||
* @since DOM Level 3
|
||||
*/
|
||||
class CDOM_EXPORT DOMXPathResult
|
||||
{
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden constructors
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Hidden constructors */
|
||||
//@{
|
||||
DOMXPathResult() {};
|
||||
//@}
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Unimplemented constructors and operators */
|
||||
//@{
|
||||
DOMXPathResult(const DOMXPathResult &);
|
||||
DOMXPathResult& operator = (const DOMXPathResult&);
|
||||
//@}
|
||||
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// All constructors are hidden, just the destructor is available
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Destructor */
|
||||
//@{
|
||||
/**
|
||||
* Destructor
|
||||
*
|
||||
*/
|
||||
virtual ~DOMXPathResult() {};
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Class Types
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Public Constants */
|
||||
//@{
|
||||
/**
|
||||
* <p>ANY_TYPE
|
||||
* <br>[XPath 1.0] This code does not represent a specific type. An evaluation of an XPath
|
||||
* expression will never produce this type. If this type is requested, then
|
||||
* the evaluation returns whatever type naturally results from evaluation
|
||||
* of the expression.
|
||||
* If the natural result is a node set when ANY_TYPE was requested, then
|
||||
* UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. Any other
|
||||
* representation of a node set must be explicitly requested.
|
||||
* <p>ANY_UNORDERED_NODE_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 and will be accessed
|
||||
* as a single node, which may be null if the node set is empty. Document
|
||||
* modification does not invalidate the node, but may mean that the result
|
||||
* node no longer corresponds to the current document. This is a convenience
|
||||
* that permits optimization since the implementation can stop once any node
|
||||
* in the resulting set has been found.
|
||||
* If there is more than one node in the actual result, the single node
|
||||
* returned might not be the first in document order.
|
||||
* <p>BOOLEAN_TYPE
|
||||
* <br>[XPath 1.0] The result is a boolean as defined by XPath 1.0. Document modification
|
||||
* does not invalidate the boolean, but may mean that reevaluation would not
|
||||
* yield the same boolean.
|
||||
* <p>FIRST_ORDERED_NODE_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 and will be accessed
|
||||
* as a single node, which may be null if the node set is empty. Document
|
||||
* modification does not invalidate the node, but may mean that the result
|
||||
* node no longer corresponds to the current document. This is a convenience
|
||||
* that permits optimization since the implementation can stop once the first
|
||||
* node in document order of the resulting set has been found.
|
||||
* If there are more than one node in the actual result, the single node
|
||||
* returned will be the first in document order.
|
||||
* <p>NUMBER_TYPE
|
||||
* <br>[XPath 1.0] The result is a number as defined by XPath 1.0. Document modification does
|
||||
* not invalidate the number, but may mean that reevaluation would not yield the
|
||||
* same number.
|
||||
* <p>ORDERED_NODE_ITERATOR_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed
|
||||
* iteratively, which will produce document-ordered nodes. Document modification
|
||||
* invalidates the iteration.
|
||||
* <p>ORDERED_NODE_SNAPSHOT_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed as a
|
||||
* snapshot list of nodes that will be in original document order. Document
|
||||
* modification does not invalidate the snapshot but may mean that reevaluation would
|
||||
* not yield the same snapshot and nodes in the snapshot may have been altered, moved,
|
||||
* or removed from the document.
|
||||
* <p>STRING_TYPE
|
||||
* <br>[XPath 1.0] The result is a string as defined by XPath 1.0. Document modification does not
|
||||
* invalidate the string, but may mean that the string no longer corresponds to the
|
||||
* current document.
|
||||
* <p>UNORDERED_NODE_ITERATOR_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed iteratively,
|
||||
* which may not produce nodes in a particular order. Document modification invalidates the iteration.
|
||||
* This is the default type returned if the result is a node set and ANY_TYPE is requested.
|
||||
* <p>UNORDERED_NODE_SNAPSHOT_TYPE
|
||||
* <br>[XPath 1.0] The result is a node set as defined by XPath 1.0 that will be accessed as a
|
||||
* snapshot list of nodes that may not be in a particular order. Document modification
|
||||
* does not invalidate the snapshot but may mean that reevaluation would not yield the same
|
||||
* snapshot and nodes in the snapshot may have been altered, moved, or removed from the document.
|
||||
* <p>FIRST_RESULT_TYPE
|
||||
* <br>[XPath 2.0] The result is a sequence as defined by XPath 2.0 and will be accessed
|
||||
* as a single current value or there will be no current value if the sequence
|
||||
* is empty. Document modification does not invalidate the value, but may mean
|
||||
* that the result no longer corresponds to the current document. This is a
|
||||
* convenience that permits optimization since the implementation can stop once
|
||||
* the first item in the resulting sequence has been found. If there is more
|
||||
* than one item in the actual result, the single item returned might not be
|
||||
* the first in document order.
|
||||
* <p>ITERATOR_RESULT_TYPE
|
||||
* <br>[XPath 2.0] The result is a sequence as defined by XPath 2.0 that will be accessed
|
||||
* iteratively. Document modification invalidates the iteration.
|
||||
* <p>SNAPSHOT_RESULT_TYPE
|
||||
* <br>[XPath 2.0] The result is a sequence as defined by XPath 2.0 that will be accessed
|
||||
* as a snapshot list of values. Document modification does not invalidate the
|
||||
* snapshot but may mean that reevaluation would not yield the same snapshot
|
||||
* and any items in the snapshot may have been altered, moved, or removed from
|
||||
* the document.
|
||||
*/
|
||||
enum ResultType {
|
||||
/* XPath 1.0 */
|
||||
ANY_TYPE = 0,
|
||||
NUMBER_TYPE = 1,
|
||||
STRING_TYPE = 2,
|
||||
BOOLEAN_TYPE = 3,
|
||||
UNORDERED_NODE_ITERATOR_TYPE = 4,
|
||||
ORDERED_NODE_ITERATOR_TYPE = 5,
|
||||
UNORDERED_NODE_SNAPSHOT_TYPE = 6,
|
||||
ORDERED_NODE_SNAPSHOT_TYPE = 7,
|
||||
ANY_UNORDERED_NODE_TYPE = 8,
|
||||
FIRST_ORDERED_NODE_TYPE = 9,
|
||||
/* XPath 2.0 */
|
||||
FIRST_RESULT_TYPE = 100,
|
||||
ITERATOR_RESULT_TYPE = 101,
|
||||
SNAPSHOT_RESULT_TYPE = 102
|
||||
};
|
||||
//@}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual DOMXPathResult interface
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Functions introduced in DOM Level 3 */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Returns the result type of this result
|
||||
* @return ResultType
|
||||
* A code representing the type of this result, as defined by the type constants.
|
||||
*/
|
||||
virtual ResultType getResultType() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the DOM type info of the current result node or value
|
||||
* (XPath 2 only).
|
||||
* @return typeInfo of type TypeInfo, readonly
|
||||
*/
|
||||
virtual const DOMTypeInfo *getTypeInfo() const = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the result has a current result and the value is a
|
||||
* node (XPath 2 only). This function is necessary to distinguish
|
||||
* between a string value and a node of type string as returned by
|
||||
* the getTypeInfo() function.
|
||||
* @return isNode of type boolean, readonly
|
||||
*/
|
||||
virtual bool isNode() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the boolean value of this result
|
||||
* @return booleanValue of type boolean
|
||||
* The value of this boolean result.
|
||||
* @exception DOMXPathException
|
||||
* TYPE_ERR: raised if ResultType is not BOOLEAN_TYPE (XPath 1.0) or
|
||||
* if current result cannot be properly converted to boolean (XPath 2.0).
|
||||
* <br>
|
||||
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0).
|
||||
*/
|
||||
virtual bool getBooleanValue() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the integer value of this result (XPath 2 only).
|
||||
* @return integerValue of type int
|
||||
* The value of this integer result.
|
||||
* @exception DOMXPathException
|
||||
* TYPE_ERR: raised if current result cannot be properly converted to
|
||||
* int (XPath 2.0).
|
||||
* <br>
|
||||
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0).
|
||||
*/
|
||||
virtual int getIntegerValue() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the number value of this result
|
||||
* @return numberValue
|
||||
* The value of this number result. If the native double type of the DOM
|
||||
* binding does not directly support the exact IEEE 754 result of the XPath
|
||||
* expression, then it is up to the definition of the binding to specify how
|
||||
* the XPath number is converted to the native binding number.
|
||||
* @exception DOMXPathException
|
||||
* TYPE_ERR: raised if ResultType is not NUMBER_TYPE (XPath 1.0) or
|
||||
* if current result cannot be properly converted to double (XPath 2.0).
|
||||
* <br>
|
||||
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0).
|
||||
*/
|
||||
virtual double getNumberValue() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the string value of this result
|
||||
* @return stringValue
|
||||
* The value of this string result.
|
||||
* @exception DOMXPathException
|
||||
* TYPE_ERR: raised if ResultType is not STRING_TYPE (XPath 1.0) or
|
||||
* if current result cannot be properly converted to string (XPath 2.0).
|
||||
* <br>
|
||||
* NO_RESULT_ERROR: raised if there is no current result in the result object (XPath 2.0).
|
||||
*/
|
||||
virtual const XMLCh* getStringValue() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the node value of this result
|
||||
* @return nodeValue
|
||||
* The value of this node result, which may be null.
|
||||
* @exception DOMXPathException
|
||||
* TYPE_ERR: raised if ResultType is not ANY_UNORDERED_NODE_TYPE,
|
||||
* FIRST_ORDERED_NODE_TYPE, UNORDERED_NODE_ITERATOR_TYPE,
|
||||
* ORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_SNAPSHOT_TYPE, or
|
||||
* ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if current result is
|
||||
* not a node (XPath 2.0).
|
||||
* <br>
|
||||
* NO_RESULT_ERROR: raised if there is no current result in the result
|
||||
* object.
|
||||
*/
|
||||
virtual DOMNode* getNodeValue() const = 0;
|
||||
|
||||
/**
|
||||
* Iterates and returns true if the current result is the next item from the
|
||||
* sequence or false if there are no more items.
|
||||
* @return boolean True if the current result is the next item from the sequence
|
||||
* or false if there are no more items.
|
||||
* @exception XPathException
|
||||
* TYPE_ERR: raised if ResultType is not UNORDERED_NODE_ITERATOR_TYPE or
|
||||
* ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or if ResultType is not
|
||||
* ITERATOR_RESULT_TYPE (XPath 2.0).
|
||||
* @exception DOMException
|
||||
* INVALID_STATE_ERR: The document has been mutated since the result was returned.
|
||||
*/
|
||||
virtual bool iterateNext() = 0;
|
||||
|
||||
/**
|
||||
* Signifies that the iterator has become invalid.
|
||||
* @return invalidIteratorState
|
||||
* True if ResultType is UNORDERED_NODE_ITERATOR_TYPE or
|
||||
* ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or ITERATOR_RESULT_TYPE (XPath 2.0)
|
||||
* and the document has been modified since this result was returned.
|
||||
* @exception XPathException
|
||||
* TYPE_ERR: raised if ResultType is not UNORDERED_NODE_ITERATOR_TYPE or
|
||||
* ORDERED_NODE_ITERATOR_TYPE (XPath 1.0) or if ResultType is not
|
||||
* ITERATOR_RESULT_TYPE (XPath 2.0).
|
||||
*/
|
||||
virtual bool getInvalidIteratorState() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the current result to the indexth item in the snapshot collection. If
|
||||
* index is greater than or equal to the number of items in the list, this method
|
||||
* returns false. Unlike the iterator result, the snapshot does not become
|
||||
* invalid, but may not correspond to the current document if it is mutated.
|
||||
* @param index of type XMLSize_t - Index into the snapshot collection.
|
||||
* @return boolean True if the current result is the next item from the sequence
|
||||
* or false if there are no more items.
|
||||
* @exception XPathException
|
||||
* TYPE_ERR: raised if ResultType is not UNORDERED_NODE_SNAPSHOT_TYPE or
|
||||
* ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if ResultType is not
|
||||
* SNAPSHOT_RESULT_TYPE (XPath 2.0).
|
||||
*/
|
||||
virtual bool snapshotItem(XMLSize_t index) = 0;
|
||||
|
||||
/**
|
||||
* The number of items in the result snapshot. Valid values for snapshotItem
|
||||
* indices are 0 to snapshotLength-1 inclusive.
|
||||
* @return snapshotLength of type XMLSize_t
|
||||
* @exception XPathException
|
||||
* TYPE_ERR: raised if ResultType is not UNORDERED_NODE_SNAPSHOT_TYPE or
|
||||
* ORDERED_NODE_SNAPSHOT_TYPE (XPath 1.0) or if ResultType is not
|
||||
* SNAPSHOT_RESULT_TYPE (XPath 2.0).
|
||||
*/
|
||||
virtual XMLSize_t getSnapshotLength() const = 0;
|
||||
|
||||
//@}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Non-standard Extension
|
||||
// -----------------------------------------------------------------------
|
||||
/** @name Non-standard Extension */
|
||||
//@{
|
||||
/**
|
||||
* Called to indicate that this DOMXPathResult is no longer in use
|
||||
* and that the implementation may relinquish any resources associated with it.
|
||||
*
|
||||
* Access to a released object will lead to unexpected result.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
//@}
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: StDOMNode.hpp 570480 2007-08-28 16:36:34Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_STDOMNODE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_STDOMNODE_HPP
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMAttr.hpp>
|
||||
#include <xercesc/dom/DOMElement.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/* This class is a smart pointer implementation over DOMNode interface and
|
||||
** classes derived from it. It takes care of reference counting automatically.
|
||||
** Reference counting is optional so use of this class is experimental.
|
||||
*/
|
||||
template <class T> class StDOMNode {
|
||||
T* m_node;
|
||||
|
||||
static inline void INCREFCOUNT(T *x) { if (x != (T*)0) x->incRefCount(); }
|
||||
static inline void DECREFCOUNT(T *x) { if (x != (T*)0) x->decRefCount(); }
|
||||
|
||||
public:
|
||||
inline StDOMNode(T* node = (T*)0) : m_node(node) { INCREFCOUNT(m_node); }
|
||||
inline StDOMNode(const StDOMNode& stNode) : m_node(stNode.m_node) { INCREFCOUNT(m_node); }
|
||||
inline ~StDOMNode() { DECREFCOUNT(m_node); }
|
||||
|
||||
inline T* operator= (T *node)
|
||||
{
|
||||
if (m_node != node) {
|
||||
DECREFCOUNT(m_node);
|
||||
m_node = node;
|
||||
INCREFCOUNT(m_node);
|
||||
}
|
||||
return (m_node);
|
||||
}
|
||||
|
||||
inline bool operator!= (T* node) const { return (m_node != node); }
|
||||
inline bool operator== (T* node) const { return (m_node == node); }
|
||||
|
||||
inline T& operator* () { return (*m_node); }
|
||||
inline const T& operator* () const { return (*m_node); }
|
||||
inline T* operator-> () const { return (m_node); }
|
||||
inline operator T*() const { return (m_node); }
|
||||
inline void ClearNode() { operator=((T*)(0)); }
|
||||
};
|
||||
|
||||
#if defined(XML_DOMREFCOUNT_EXPERIMENTAL)
|
||||
typedef StDOMNode<DOMNode> DOMNodeSPtr;
|
||||
#else
|
||||
typedef DOMNode* DOMNodeSPtr;
|
||||
#endif
|
||||
|
||||
/* StDOMNode is a smart pointer implementation over DOMNode interface and
|
||||
** classes derived from it. It takes care of reference counting automatically.
|
||||
** Reference counting is optional so use of this class is experimental.
|
||||
*/
|
||||
#if defined(XML_DOMREFCOUNT_EXPERIMENTAL)
|
||||
typedef StDOMNode<DOMAttr> DOMAttrSPtr;
|
||||
#else
|
||||
typedef DOMAttr* DOMAttrSPtr;
|
||||
#endif
|
||||
|
||||
/* StDOMNode is a smart pointer implementation over DOMNode interface and
|
||||
** classes derived from it. It takes care of reference counting automatically.
|
||||
** Reference counting is optional so use of this class is experimental.
|
||||
*/
|
||||
#if defined(XML_DOMREFCOUNT_EXPERIMENTAL)
|
||||
typedef StDOMNode<DOMElement> DOMElementSPtr;
|
||||
#else
|
||||
typedef DOMElement* DOMElementSPtr;
|
||||
#endif
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMAttrImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include "DOMParentNode.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMDocumentImpl.hpp"
|
||||
#include <xercesc/dom/DOMAttr.hpp>
|
||||
#include <xercesc/framework/XMLBuffer.hpp>
|
||||
#include "DOMNodeIDMap.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMElementImpl;
|
||||
class DOMTypeInfoImpl;
|
||||
|
||||
class CDOM_EXPORT DOMAttrImpl: public DOMAttr {
|
||||
|
||||
public:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
const XMLCh *fName;
|
||||
|
||||
protected:
|
||||
const DOMTypeInfoImpl *fSchemaType;
|
||||
|
||||
public:
|
||||
DOMAttrImpl(DOMDocument *ownerDocument, const XMLCh *aName);
|
||||
DOMAttrImpl(const DOMAttrImpl &other, bool deep=false);
|
||||
virtual ~DOMAttrImpl();
|
||||
|
||||
public:
|
||||
// Add all functions that are pure virtual in DOMNODE
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
virtual const XMLCh * getName() const;
|
||||
virtual bool getSpecified() const;
|
||||
virtual const XMLCh * getValue() const;
|
||||
virtual void setSpecified(bool arg);
|
||||
virtual void setValue(const XMLCh * value);
|
||||
virtual DOMElement * getOwnerElement() const;
|
||||
virtual bool isId() const;
|
||||
virtual const DOMTypeInfo* getSchemaTypeInfo() const;
|
||||
|
||||
void setOwnerElement(DOMElement *ownerElem); //internal use only
|
||||
|
||||
// helper function for DOM Level 3 renameNode
|
||||
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
|
||||
//helper function for DOM Level 3 TypeInfo
|
||||
virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo);
|
||||
|
||||
// helper method that sets this attr to an idnode and places it into the document map
|
||||
virtual void addAttrToIDNodeMap();
|
||||
|
||||
// helper to remove this attr from from the id map if it is in there
|
||||
virtual void removeAttrFromIDNodeMap();
|
||||
|
||||
public:
|
||||
// Set attribute value fast. Assumptions:
|
||||
//
|
||||
// - node is not read-only
|
||||
// - no ID management is performed
|
||||
// - this attribute does not have a value
|
||||
//
|
||||
virtual void setValueFast (const XMLCh * value);
|
||||
|
||||
protected:
|
||||
void getTextValue(DOMNode* node, XMLBuffer& buf) const;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMAttrImpl& operator=(const DOMAttrImpl&);
|
||||
};
|
||||
|
||||
inline void DOMAttrImpl::removeAttrFromIDNodeMap()
|
||||
{
|
||||
if (fNode.isIdAttr()) {
|
||||
((DOMDocumentImpl *)fParent.fOwnerDocument)->getNodeIDMap()->remove(this);
|
||||
fNode.isIdAttr(false);
|
||||
}
|
||||
}
|
||||
|
||||
inline void DOMAttrImpl::addAttrToIDNodeMap()
|
||||
{
|
||||
if (fNode.isIdAttr())
|
||||
return;
|
||||
|
||||
fNode.isIdAttr(true);
|
||||
|
||||
// REVIST For now, we don't worry about what happens if the new
|
||||
// name conflicts as per setValue
|
||||
DOMDocumentImpl *doc = (DOMDocumentImpl *)(fParent.fOwnerDocument);
|
||||
|
||||
if (doc->fNodeIDMap == 0)
|
||||
doc->fNodeIDMap = new (doc) DOMNodeIDMap(500, doc);
|
||||
|
||||
doc->getNodeIDMap()->add(this);
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMAttrMapImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNamedNodeMap.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMNode;
|
||||
class DOMNodeVector;
|
||||
|
||||
class CDOM_EXPORT DOMAttrMapImpl : public DOMNamedNodeMap
|
||||
{
|
||||
protected:
|
||||
DOMNodeVector* fNodes;
|
||||
DOMNode* fOwnerNode; // the node this map belongs to
|
||||
bool attrDefaults;
|
||||
|
||||
virtual void cloneContent(const DOMAttrMapImpl *srcmap);
|
||||
|
||||
bool readOnly(); // revisit. Look at owner node read-only.
|
||||
|
||||
public:
|
||||
DOMAttrMapImpl(DOMNode *ownerNod);
|
||||
|
||||
// revisit. This "copy" constructor is used for cloning an Element with Attributes,
|
||||
// and for setting up default attributes. It's probably not right
|
||||
// for one or the other or both.
|
||||
DOMAttrMapImpl(DOMNode *ownerNod, const DOMAttrMapImpl *defaults);
|
||||
DOMAttrMapImpl();
|
||||
|
||||
virtual ~DOMAttrMapImpl();
|
||||
virtual DOMAttrMapImpl *cloneAttrMap(DOMNode *ownerNode);
|
||||
virtual bool hasDefaults();
|
||||
virtual void hasDefaults(bool value);
|
||||
virtual int findNamePoint(const XMLCh *name) const;
|
||||
virtual int findNamePoint(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual DOMNode* removeNamedItemAt(XMLSize_t index);
|
||||
virtual void setReadOnly(bool readOnly, bool deep);
|
||||
|
||||
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual DOMNode* item(XMLSize_t index) const;
|
||||
|
||||
virtual DOMNode* getNamedItem(const XMLCh *name) const;
|
||||
virtual DOMNode* setNamedItem(DOMNode *arg);
|
||||
virtual DOMNode* removeNamedItem(const XMLCh *name);
|
||||
|
||||
virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual DOMNode* setNamedItemNS(DOMNode *arg);
|
||||
virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName);
|
||||
|
||||
// Fast versions of the above functions which bypass validity checks.
|
||||
// It also assumes that fNode is not 0 (call reserve) and that there
|
||||
// is no previous node with this name. These are used in parsing.
|
||||
//
|
||||
void setNamedItemFast(DOMNode *arg);
|
||||
void setNamedItemNSFast(DOMNode *arg);
|
||||
|
||||
// Tries to reserve space for the specified number of elements.
|
||||
// Currently only works on newly-created instances (fNodes == 0).
|
||||
//
|
||||
void reserve (XMLSize_t);
|
||||
|
||||
void reconcileDefaultAttributes(const DOMAttrMapImpl* defaults);
|
||||
void moveSpecifiedAttributes(DOMAttrMapImpl* srcmap);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMAttrMapImpl(const DOMAttrMapImpl &);
|
||||
DOMAttrMapImpl & operator = (const DOMAttrMapImpl &);
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DOMAttrMapImpl: Getters & Setters
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
inline bool DOMAttrMapImpl::hasDefaults()
|
||||
{
|
||||
return attrDefaults;
|
||||
}
|
||||
|
||||
inline void DOMAttrMapImpl::hasDefaults(bool value)
|
||||
{
|
||||
attrDefaults = value;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMAttrNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include "DOMAttrImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMAttrNSImpl: public DOMAttrImpl {
|
||||
protected:
|
||||
//Introduced in DOM Level 2
|
||||
const XMLCh * fNamespaceURI; //namespace URI of this node
|
||||
const XMLCh * fLocalName; //local part of qualified name
|
||||
const XMLCh * fPrefix; // prefix part of qualified name
|
||||
// revisit - can return local part
|
||||
// by pointing into the qualified (L1) name.
|
||||
|
||||
public:
|
||||
DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
|
||||
DOMAttrNSImpl(DOMDocument *ownerDoc, //DOM Level 2
|
||||
const XMLCh *namespaceURI, const XMLCh *qualifiedName);
|
||||
DOMAttrNSImpl(const DOMAttrNSImpl &other, bool deep=false);
|
||||
|
||||
// Fast construction without any checks for name validity. Used in
|
||||
// parsing. Note that if prefix is not specified and localName is
|
||||
// 'xmlns', this constructor expects proper namespaceURI.
|
||||
//
|
||||
DOMAttrNSImpl(DOMDocument *ownerDoc,
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *prefix, // Null or empty - no prefix.
|
||||
const XMLCh *localName,
|
||||
const XMLCh *qualifiedName);
|
||||
|
||||
virtual DOMNode * cloneNode(bool deep) const;
|
||||
//Introduced in DOM Level 2
|
||||
virtual const XMLCh * getNamespaceURI() const;
|
||||
virtual const XMLCh * getPrefix() const;
|
||||
virtual const XMLCh * getLocalName() const;
|
||||
virtual void setPrefix(const XMLCh *prefix);
|
||||
virtual void release();
|
||||
|
||||
// helper function for DOM Level 3 renameNode
|
||||
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
void setName(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMAttrNSImpl & operator = (const DOMAttrNSImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCDATASectionImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMCDATASection.hpp>
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMParentNode.hpp"
|
||||
#include "DOMCharacterDataImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMCDATASectionImpl: public DOMCDATASection {
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMChildNode fChild;
|
||||
DOMCharacterDataImpl fCharacterData;
|
||||
|
||||
|
||||
public:
|
||||
DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data);
|
||||
DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n);
|
||||
DOMCDATASectionImpl(const DOMCDATASectionImpl &other, bool deep = false);
|
||||
|
||||
virtual ~DOMCDATASectionImpl();
|
||||
|
||||
// Functions inherited from TEXT
|
||||
virtual DOMText* splitText(XMLSize_t offset);
|
||||
// DOM Level 3
|
||||
virtual bool getIsElementContentWhitespace() const;
|
||||
virtual const XMLCh* getWholeText() const;
|
||||
virtual DOMText* replaceWholeText(const XMLCh* content);
|
||||
|
||||
// non-standard extension
|
||||
virtual bool isIgnorableWhitespace() const;
|
||||
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// Functions introduced by DOMCharacterData
|
||||
virtual const XMLCh* getData() const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual const XMLCh* substringData(XMLSize_t offset,
|
||||
XMLSize_t count) const;
|
||||
virtual void appendData(const XMLCh *arg);
|
||||
virtual void insertData(XMLSize_t offset, const XMLCh *arg);
|
||||
virtual void deleteData(XMLSize_t offset,
|
||||
XMLSize_t count);
|
||||
virtual void replaceData(XMLSize_t offset,
|
||||
XMLSize_t count,
|
||||
const XMLCh *arg);
|
||||
virtual void setData(const XMLCh *data);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMCDATASectionImpl & operator = (const DOMCDATASectionImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCasts.hpp 673975 2008-07-04 09:23:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCASTS_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCASTS_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
//
|
||||
// Define inline casting functions to convert from
|
||||
// (DOMNode *) to DOMParentNode or DOMChildNode *.
|
||||
//
|
||||
// This requires knowledge of the structure of the fields of
|
||||
// for all node types. There are three categories -
|
||||
//
|
||||
// Nodetypes that can have children and can be a child themselves.
|
||||
// e.g. Elements
|
||||
//
|
||||
// Object
|
||||
// DOMNodeImpl fNode;
|
||||
// DOMParentNode fParent;
|
||||
// DOMChildNode fChild;
|
||||
// ... // other fields, depending on node type.
|
||||
//
|
||||
// Nodetypes that can not have children, e.g. TEXT
|
||||
//
|
||||
// Object
|
||||
// DOMNodeImpl fNode;
|
||||
// DOMChildNode fChild;
|
||||
// ... // other fields, depending on node type
|
||||
//
|
||||
// Nodetypes that can not be a child of other nodes, but that can
|
||||
// have children (are a parent) e.g. ATTR
|
||||
// Object
|
||||
// DOMNodeImpl fNode;
|
||||
// DOMParentNode fParent
|
||||
// ... // other fields, depending on node type
|
||||
//
|
||||
// The casting functions make these assumptions:
|
||||
// 1. The cast is possible. Using code will not attempt to
|
||||
// cast to something that does not exist, such as the child
|
||||
// part of an ATTR
|
||||
//
|
||||
// 2. The nodes belong to this implementation.
|
||||
//
|
||||
// Some of the casts use the LEAFNODE flag in the common fNode part to
|
||||
// determine whether an fParent field exists, and thus the
|
||||
// position of the fChild part within the node.
|
||||
//
|
||||
// These functions also cast off const. It was either do that, or make
|
||||
// a second overloaded set that took and returned const arguements.
|
||||
//
|
||||
|
||||
//
|
||||
// Note that using offsetof, or taking the offset of an object member at
|
||||
// a 0 address, is now undefined in C++. And gcc now warns about this behavior.
|
||||
// This is because doing do so is unreliable for some types of objects.
|
||||
// See: http://gcc.gnu.org/ml/gcc/2004-06/msg00227.html
|
||||
// : http://gcc.gnu.org/ml/gcc-bugs/2000-03/msg00805.html
|
||||
// The casting code below works around gcc's warnings by using a dummy
|
||||
// pointer, which the compiler cannot tell is null. The defeats the warning,
|
||||
// but also masks the potential problem.
|
||||
// The gcc option -Wno-invalid-offsetof may also be used to turn off this warning.
|
||||
//
|
||||
|
||||
#include "DOMElementImpl.hpp"
|
||||
#include "DOMTextImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
static inline DOMNodeImpl *castToNodeImpl(const DOMNode *p)
|
||||
{
|
||||
DOMElementImpl *pE = (DOMElementImpl *)p;
|
||||
return &(pE->fNode);
|
||||
}
|
||||
|
||||
|
||||
static inline DOMParentNode *castToParentImpl(const DOMNode *p) {
|
||||
DOMElementImpl *pE = (DOMElementImpl *)p;
|
||||
return &(pE->fParent);
|
||||
}
|
||||
|
||||
|
||||
static inline DOMChildNode *castToChildImpl(const DOMNode *p) {
|
||||
DOMElementImpl *pE = (DOMElementImpl *)p;
|
||||
if (pE->fNode.isLeafNode()) {
|
||||
DOMTextImpl *pT = (DOMTextImpl *)p;
|
||||
return &(pT->fChild);
|
||||
}
|
||||
return &(pE->fChild);
|
||||
}
|
||||
|
||||
|
||||
static inline DOMNode *castToNode(const DOMParentNode *p ) {
|
||||
DOMElementImpl* dummy = 0;
|
||||
XMLSize_t parentOffset = (char *)&(dummy->fParent) - (char *)dummy;
|
||||
char *retPtr = (char *)p - parentOffset;
|
||||
return (DOMNode *)retPtr;
|
||||
}
|
||||
|
||||
static inline DOMNode *castToNode(const DOMNodeImpl *p) {
|
||||
DOMElementImpl* dummy = 0;
|
||||
XMLSize_t nodeImplOffset = (char *)&(dummy->fNode) - (char *)dummy;
|
||||
char *retPtr = (char *)p - nodeImplOffset;
|
||||
return (DOMNode *)retPtr;
|
||||
}
|
||||
|
||||
|
||||
static inline DOMNodeImpl *castToNodeImpl(const DOMParentNode *p)
|
||||
{
|
||||
DOMElementImpl* dummy = 0;
|
||||
XMLSize_t nodeImplOffset = (char *)&(dummy->fNode) - (char *)dummy;
|
||||
XMLSize_t parentOffset = (char *)&(dummy->fParent) - (char *)dummy;
|
||||
char *retPtr = (char *)p - parentOffset + nodeImplOffset;
|
||||
return (DOMNodeImpl *)retPtr;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCharacterDataImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
class DOMDocument;
|
||||
class DOMDocumentImpl;
|
||||
class DOMBuffer;
|
||||
|
||||
// Instances of DOMCharacterDataImpl appear as members of node types
|
||||
// that implement the DOMCharacterData interfaces.
|
||||
// Operations in those classes are delegated to this class.
|
||||
//
|
||||
class CDOM_EXPORT DOMCharacterDataImpl
|
||||
{
|
||||
public:
|
||||
DOMBuffer* fDataBuf;
|
||||
// for the buffer bid
|
||||
DOMDocumentImpl* fDoc;
|
||||
|
||||
public:
|
||||
DOMCharacterDataImpl(DOMDocument *doc, const XMLCh *dat);
|
||||
DOMCharacterDataImpl(DOMDocument *doc, const XMLCh* data, XMLSize_t n);
|
||||
DOMCharacterDataImpl(const DOMCharacterDataImpl &other);
|
||||
~DOMCharacterDataImpl();
|
||||
const XMLCh * getNodeValue() const;
|
||||
void setNodeValue(const XMLCh * value);
|
||||
void appendData(const DOMNode *node, const XMLCh *data);
|
||||
void appendData(const DOMNode *node, const XMLCh *data, XMLSize_t n);
|
||||
void deleteData(const DOMNode *node, XMLSize_t offset, XMLSize_t count);
|
||||
const XMLCh* getData() const;
|
||||
XMLSize_t getLength() const;
|
||||
void insertData(const DOMNode *node, XMLSize_t offset, const XMLCh * data);
|
||||
void replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count, const XMLCh * data);
|
||||
void setData(const DOMNode *node, const XMLCh * arg);
|
||||
void setNodeValue(const DOMNode *node, const XMLCh *value);
|
||||
|
||||
|
||||
const XMLCh* substringData(const DOMNode *node, XMLSize_t offset, XMLSize_t count) const;
|
||||
void releaseBuffer();
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMCharacterDataImpl & operator = (const DOMCharacterDataImpl &);
|
||||
};
|
||||
|
||||
#define GetDOMCharacterDataImplMemoryManager GET_DIRECT_MM(fDoc)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMChildNode.hpp 527149 2007-04-10 14:56:39Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
/**
|
||||
* ChildNode adds to NodeImpl the capability of being a child, this is having
|
||||
* siblings.
|
||||
**/
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMDocument;
|
||||
class DOMNode;
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMChildNode {
|
||||
|
||||
public:
|
||||
DOMNode *previousSibling;
|
||||
DOMNode *nextSibling;
|
||||
|
||||
DOMChildNode();
|
||||
DOMChildNode(const DOMChildNode &other);
|
||||
~DOMChildNode();
|
||||
|
||||
DOMNode * getNextSibling() const;
|
||||
DOMNode * getParentNode(const DOMNode *thisNode) const;
|
||||
DOMNode * getPreviousSibling(const DOMNode *thisNode) const;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMChildNode & operator = (const DOMChildNode &);
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMCommentImpl.hpp 676911 2008-07-15 13:27:32Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMComment.hpp>
|
||||
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMCharacterDataImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMCommentImpl: public DOMComment {
|
||||
public:
|
||||
DOMNodeImpl fNode;
|
||||
DOMChildNode fChild;
|
||||
DOMCharacterDataImpl fCharacterData;
|
||||
|
||||
public:
|
||||
DOMCommentImpl(DOMDocument *, const XMLCh *);
|
||||
DOMCommentImpl(const DOMCommentImpl &other, bool deep);
|
||||
virtual ~DOMCommentImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// Functions from DOMCharacterData
|
||||
virtual void appendData(const XMLCh *data);
|
||||
virtual void deleteData(XMLSize_t offset, XMLSize_t count);
|
||||
virtual const XMLCh * getData() const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual void insertData(XMLSize_t offset, const XMLCh * data);
|
||||
virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh * data);
|
||||
virtual void setData(const XMLCh * arg);
|
||||
virtual const XMLCh * substringData(XMLSize_t offset, XMLSize_t count) const;
|
||||
|
||||
// Non standard extension for the range to work
|
||||
DOMComment* splitText(XMLSize_t offset);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMCommentImpl & operator = (const DOMCommentImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
#include <xercesc/dom/DOMConfiguration.hpp>
|
||||
#include <xercesc/dom/DOMErrorHandler.hpp>
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMDocumentImpl;
|
||||
class DOMStringListImpl;
|
||||
|
||||
class CDOM_EXPORT DOMConfigurationImpl : public DOMConfiguration
|
||||
{
|
||||
private:
|
||||
//unimplemented
|
||||
DOMConfigurationImpl(const DOMConfiguration &);
|
||||
DOMConfigurationImpl & operator = (const DOMConfiguration &);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------------
|
||||
DOMConfigurationImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMConfigurationImpl();
|
||||
|
||||
enum DOMConfigurationFeature {
|
||||
FEATURE_CANONICAL_FORM = 0x0001,
|
||||
FEATURE_CDATA_SECTIONS = 0x0002,
|
||||
FEATURE_COMMENTS = 0x0004,
|
||||
FEATURE_DATATYPE_NORMALIZATION = 0x0008,
|
||||
FEATURE_DISCARD_DEFAULT_CONTENT = 0x0010,
|
||||
FEATURE_ENTITIES = 0x0020,
|
||||
FEATURE_INFOSET = 0x0040,
|
||||
FEATURE_NAMESPACES = 0x0080,
|
||||
FEATURE_NAMESPACE_DECLARATIONS = 0x0100,
|
||||
FEATURE_NORMALIZE_CHARACTERS = 0x0200,
|
||||
FEATURE_SPLIT_CDATA_SECTIONS = 0x0400,
|
||||
FEATURE_VALIDATE = 0x0800,
|
||||
FEATURE_VALIDATE_IF_SCHEMA = 0x1000,
|
||||
FEATURE_ELEMENT_CONTENT_WHITESPACE = 0x2000
|
||||
};
|
||||
|
||||
unsigned short featureValues;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
virtual void setParameter(const XMLCh* name, const void* value);
|
||||
virtual void setParameter(const XMLCh* name, bool value);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
virtual const void* getParameter(const XMLCh* name) const;
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Query methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
virtual bool canSetParameter(const XMLCh* name, const void* value) const;
|
||||
virtual bool canSetParameter(const XMLCh* name, bool value) const;
|
||||
|
||||
virtual const DOMStringList* getParameterNames() const;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Impl specific methods
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/* specific get and set methods for non-boolean parameters
|
||||
* */
|
||||
|
||||
DOMErrorHandler* getErrorHandler() const;
|
||||
|
||||
const XMLCh* getSchemaType() const;
|
||||
|
||||
const XMLCh* getSchemaLocation() const;
|
||||
|
||||
void setErrorHandler(DOMErrorHandler *erHandler);
|
||||
|
||||
void setSchemaType(const XMLCh* st);
|
||||
|
||||
void setSchemaLocation(const XMLCh* sl);
|
||||
|
||||
// The default values for the boolean parameters
|
||||
// from CANONICAL_FORM to ELEMENT_CONTENT_WHITESPACE
|
||||
// 10010110010110 = 0x2596
|
||||
static const unsigned short fDEFAULT_VALUES;
|
||||
|
||||
|
||||
protected:
|
||||
// implements a simple map between the name and its enum value
|
||||
DOMConfigurationFeature getFeatureFlag(const XMLCh* name) const;
|
||||
|
||||
// the error handler
|
||||
DOMErrorHandler* fErrorHandler;
|
||||
|
||||
// the schema type
|
||||
const XMLCh* fSchemaType;
|
||||
|
||||
// the schema location
|
||||
const XMLCh* fSchemaLocation;
|
||||
|
||||
// the list of supported parameters
|
||||
DOMStringListImpl* fSupportedParameters;
|
||||
|
||||
MemoryManager* fMemoryManager;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMConfigurationImpl.hpp
|
||||
*/
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDeepNodeListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNodeList.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMDeepNodeListImpl: public DOMNodeList {
|
||||
protected:
|
||||
const DOMNode* fRootNode;
|
||||
const XMLCh* fTagName;
|
||||
bool fMatchAll;
|
||||
int fChanges;
|
||||
DOMNode* fCurrentNode;
|
||||
XMLSize_t fCurrentIndexPlus1;
|
||||
|
||||
//DOM Level 2
|
||||
const XMLCh* fNamespaceURI;
|
||||
bool fMatchAllURI;
|
||||
bool fMatchURIandTagname; //match both namespaceURI and tagName
|
||||
|
||||
public:
|
||||
DOMDeepNodeListImpl(const DOMNode *rootNode, const XMLCh *tagName);
|
||||
DOMDeepNodeListImpl(const DOMNode *rootNode, //DOM Level 2
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *localName);
|
||||
virtual ~DOMDeepNodeListImpl();
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual DOMNode* item(XMLSize_t index) const;
|
||||
DOMNode* cacheItem(XMLSize_t index);
|
||||
|
||||
protected:
|
||||
DOMNode* nextMatchingElementAfter(DOMNode *current);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDeepNodeListImpl(const DOMDeepNodeListImpl &);
|
||||
DOMDeepNodeListImpl & operator = (const DOMDeepNodeListImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,200 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDeepNodeListPool.hpp 883368 2009-11-23 15:28:19Z amassari $
|
||||
*/
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP
|
||||
|
||||
|
||||
#include <xercesc/util/Hashers.hpp>
|
||||
#include <xercesc/util/IllegalArgumentException.hpp>
|
||||
#include <xercesc/util/NoSuchElementException.hpp>
|
||||
#include <xercesc/util/RuntimeException.hpp>
|
||||
#include <xercesc/util/XMLExceptMsgs.hpp>
|
||||
#include <xercesc/util/XMLEnumerator.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
//
|
||||
// This should really be a nested class, but some of the compilers we
|
||||
// have to support cannot deal with that!
|
||||
//
|
||||
template <class TVal>
|
||||
struct DOMDeepNodeListPoolTableBucketElem : public XMemory
|
||||
{
|
||||
DOMDeepNodeListPoolTableBucketElem
|
||||
(
|
||||
void* key1
|
||||
, XMLCh* key2
|
||||
, XMLCh* key3
|
||||
, TVal* const value
|
||||
, DOMDeepNodeListPoolTableBucketElem<TVal>* next
|
||||
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
||||
) :
|
||||
fData(value)
|
||||
, fNext(next)
|
||||
, fKey1(key1)
|
||||
, fKey2(0)
|
||||
, fKey3(0)
|
||||
{
|
||||
if (key2)
|
||||
fKey2 = XMLString::replicate(key2, manager);
|
||||
|
||||
if (key3)
|
||||
fKey3 = XMLString::replicate(key3, manager);
|
||||
}
|
||||
|
||||
TVal* fData;
|
||||
DOMDeepNodeListPoolTableBucketElem<TVal>* fNext;
|
||||
void* fKey1;
|
||||
XMLCh* fKey2;
|
||||
XMLCh* fKey3;
|
||||
|
||||
~DOMDeepNodeListPoolTableBucketElem() {};
|
||||
};
|
||||
|
||||
|
||||
template <class TVal, class THasher = PtrHasher>
|
||||
class DOMDeepNodeListPool
|
||||
{
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors and Destructor
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDeepNodeListPool
|
||||
(
|
||||
const XMLSize_t modulus
|
||||
, const XMLSize_t initSize = 128
|
||||
);
|
||||
|
||||
DOMDeepNodeListPool
|
||||
(
|
||||
const XMLSize_t modulus
|
||||
, const bool adoptElems
|
||||
, const XMLSize_t initSize = 128
|
||||
);
|
||||
|
||||
DOMDeepNodeListPool
|
||||
(
|
||||
const XMLSize_t modulus
|
||||
, const bool adoptElems
|
||||
, const THasher& hasher
|
||||
, const XMLSize_t initSize = 128
|
||||
);
|
||||
|
||||
~DOMDeepNodeListPool();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Element management
|
||||
// -----------------------------------------------------------------------
|
||||
bool isEmpty() const;
|
||||
bool containsKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const;
|
||||
void removeAll();
|
||||
void cleanup();
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getters
|
||||
// -----------------------------------------------------------------------
|
||||
TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3);
|
||||
const TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const;
|
||||
|
||||
TVal* getById(const XMLSize_t elemId);
|
||||
const TVal* getById(const XMLSize_t elemId) const;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Putters
|
||||
// -----------------------------------------------------------------------
|
||||
XMLSize_t put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt);
|
||||
|
||||
private:
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Private methods
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDeepNodeListPoolTableBucketElem<TVal>* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal);
|
||||
const DOMDeepNodeListPoolTableBucketElem<TVal>* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal) const;
|
||||
void initialize(const XMLSize_t modulus);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDeepNodeListPool(const DOMDeepNodeListPool<TVal, THasher> &);
|
||||
DOMDeepNodeListPool<TVal, THasher> & operator = (const DOMDeepNodeListPool<TVal, THasher> &);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Data members
|
||||
//
|
||||
// fAdoptedElems
|
||||
// Indicates whether the values added are adopted or just referenced.
|
||||
// If adopted, then they are deleted when they are removed from the
|
||||
// hash table.
|
||||
//
|
||||
// fBucketList
|
||||
// This is the array that contains the heads of all of the list
|
||||
// buckets, one for each possible hash value.
|
||||
//
|
||||
// fHashModulus
|
||||
// The modulus used for this hash table, to hash the keys. This is
|
||||
// also the number of elements in the bucket list.
|
||||
//
|
||||
// fHash
|
||||
// The hasher for the key1 data type.
|
||||
//
|
||||
// fIdPtrs
|
||||
// fIdPtrsCount
|
||||
// This is the array of pointers to the bucket elements in order of
|
||||
// their assigned ids. So taking id N and referencing this array
|
||||
// gives you the element with that id. The count field indicates
|
||||
// the current size of this list. When fIdCounter+1 reaches this
|
||||
// value the list must be expanded.
|
||||
//
|
||||
// fIdCounter
|
||||
// This is used to give out unique ids to added elements. It starts
|
||||
// at zero (which means empty), and is bumped up for each newly added
|
||||
// element. So the first element is 1, the next is 2, etc... This
|
||||
// means that this value is set to the top index of the fIdPtrs array.
|
||||
// -----------------------------------------------------------------------
|
||||
bool fAdoptedElems;
|
||||
DOMDeepNodeListPoolTableBucketElem<TVal>** fBucketList;
|
||||
XMLSize_t fHashModulus;
|
||||
TVal** fIdPtrs;
|
||||
XMLSize_t fIdPtrsCount;
|
||||
XMLSize_t fIdCounter;
|
||||
MemoryManager* fMemoryManager;
|
||||
THasher fHasher;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#if !defined(XERCES_TMPLSINC)
|
||||
#include <xercesc/dom/impl/DOMDeepNodeListPool.c>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentFragmentImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMDocumentFragment.hpp>
|
||||
#include "DOMParentNode.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMDocumentFragmentImpl: public DOMDocumentFragment {
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
|
||||
protected:
|
||||
DOMDocumentFragmentImpl(DOMDocument *);
|
||||
DOMDocumentFragmentImpl(const DOMDocumentFragmentImpl &other, bool deep);
|
||||
friend class DOMDocumentImpl;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDocumentFragmentImpl & operator = (const DOMDocumentFragmentImpl &);
|
||||
|
||||
public:
|
||||
virtual ~DOMDocumentFragmentImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,507 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentImpl.hpp 679340 2008-07-24 10:28:29Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/RefArrayOf.hpp>
|
||||
#include <xercesc/util/RefStackOf.hpp>
|
||||
#include <xercesc/util/RefHash2KeysTableOf.hpp>
|
||||
#include <xercesc/util/StringPool.hpp>
|
||||
#include <xercesc/util/KeyRefPair.hpp>
|
||||
#include <xercesc/util/XMLChar.hpp>
|
||||
#include <xercesc/dom/DOMDocument.hpp>
|
||||
#include <xercesc/dom/DOMUserDataHandler.hpp>
|
||||
#include <xercesc/dom/DOMMemoryManager.hpp>
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMStringPool.hpp"
|
||||
#include "DOMParentNode.hpp"
|
||||
#include "DOMDeepNodeListPool.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMAttrImpl;
|
||||
class DOMCDATASectionImpl;
|
||||
class DOMCommentImpl;
|
||||
class DOMConfiguration;
|
||||
class DOMDeepNodeListImpl;
|
||||
class DOMDocumentFragmentImpl;
|
||||
class DOMDocumentTypeImpl;
|
||||
class DOMElementImpl;
|
||||
class DOMEntityImpl;
|
||||
class DOMEntityReferenceImpl;
|
||||
class DOMNotationImpl;
|
||||
class DOMProcessingInstructionImpl;
|
||||
class DOMTextImpl;
|
||||
class DOMNodeIteratorImpl;
|
||||
class DOMNormalizer;
|
||||
class DOMTreeWalkerImpl;
|
||||
class DOMNodeFilter;
|
||||
class DOMNodeFilterImpl;
|
||||
class DOMImplementation;
|
||||
class DOMNodeIDMap;
|
||||
class DOMRangeImpl;
|
||||
class DOMBuffer;
|
||||
class MemoryManager;
|
||||
class XPathNSResolver;
|
||||
class XPathExpression;
|
||||
|
||||
typedef RefVectorOf<DOMRangeImpl> Ranges;
|
||||
typedef RefVectorOf<DOMNodeIteratorImpl> NodeIterators;
|
||||
typedef KeyRefPair<void, DOMUserDataHandler> DOMUserDataRecord;
|
||||
typedef RefStackOf<DOMNode> DOMNodePtr;
|
||||
|
||||
class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMMemoryManager, public DOMDocument {
|
||||
public:
|
||||
// -----------------------------------------------------------------------
|
||||
// data
|
||||
// -----------------------------------------------------------------------
|
||||
DOMNodeImpl fNode; // Implements common node functionality.
|
||||
DOMParentNode fParent; // Implements common parent node functionality
|
||||
DOMNodeIDMap* fNodeIDMap; // for use by GetElementsById().
|
||||
|
||||
public:
|
||||
DOMDocumentImpl(DOMImplementation* domImpl, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
DOMDocumentImpl(const XMLCh* namespaceURI, //DOM Level 2
|
||||
const XMLCh* qualifiedName,
|
||||
DOMDocumentType* doctype,
|
||||
DOMImplementation* domImpl,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
virtual ~DOMDocumentImpl();
|
||||
|
||||
void setDocumentType(DOMDocumentType *doctype);
|
||||
|
||||
public:
|
||||
// Add all functions that are pure virtual in DOMNODE
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// Add all functions that are pure virtual in DOMDocument
|
||||
virtual DOMAttr* createAttribute(const XMLCh *name);
|
||||
virtual DOMCDATASection* createCDATASection(const XMLCh *data);
|
||||
virtual DOMComment* createComment(const XMLCh *data);
|
||||
virtual DOMDocumentFragment* createDocumentFragment();
|
||||
virtual DOMDocumentType* createDocumentType(const XMLCh *name);
|
||||
virtual DOMDocumentType* createDocumentType(const XMLCh *qName,
|
||||
const XMLCh *publicId,
|
||||
const XMLCh *systemId);
|
||||
virtual DOMElement* createElement(const XMLCh * tagName);
|
||||
virtual DOMElement* createElementNoCheck(const XMLCh *tagName);
|
||||
virtual DOMEntity* createEntity(const XMLCh * name);
|
||||
virtual DOMEntityReference* createEntityReference(const XMLCh * name);
|
||||
virtual DOMNotation* createNotation(const XMLCh * name);
|
||||
virtual DOMProcessingInstruction* createProcessingInstruction(const XMLCh * target, const XMLCh * data);
|
||||
virtual DOMText* createTextNode(const XMLCh * data);
|
||||
virtual DOMDocumentType* getDoctype() const;
|
||||
virtual DOMElement* getDocumentElement() const;
|
||||
virtual DOMNodeList* getElementsByTagName(const XMLCh * tagname) const;
|
||||
virtual DOMImplementation* getImplementation() const;
|
||||
bool isXMLName(const XMLCh * s);
|
||||
virtual DOMNodeIterator* createNodeIterator(DOMNode *root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* filter,
|
||||
bool entityReferenceExpansion);
|
||||
virtual DOMTreeWalker* createTreeWalker(DOMNode *root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* filter,
|
||||
bool entityReferenceExpansion);
|
||||
|
||||
|
||||
virtual DOMRange* createRange();
|
||||
virtual Ranges* getRanges() const; //non-standard api
|
||||
virtual NodeIterators* getNodeIterators() const; //non-standard api
|
||||
virtual void removeRange(DOMRangeImpl* range); //non-standard api
|
||||
virtual void removeNodeIterator(DOMNodeIteratorImpl* nodeIterator); //non-standard api
|
||||
|
||||
virtual DOMXPathExpression* createExpression(const XMLCh *expression,
|
||||
const DOMXPathNSResolver *resolver);
|
||||
virtual DOMXPathNSResolver* createNSResolver(const DOMNode *nodeResolver);
|
||||
virtual DOMXPathResult* evaluate(const XMLCh *expression,
|
||||
const DOMNode *contextNode,
|
||||
const DOMXPathNSResolver *resolver,
|
||||
DOMXPathResult::ResultType type,
|
||||
DOMXPathResult* result);
|
||||
|
||||
|
||||
// Extension to be called by the Parser
|
||||
DOMEntityReference* createEntityReferenceByParser(const XMLCh * name);
|
||||
|
||||
// Add all functions that are pure virtual in DOMMemoryManager
|
||||
virtual XMLSize_t getMemoryAllocationBlockSize() const;
|
||||
virtual void setMemoryAllocationBlockSize(XMLSize_t size);
|
||||
virtual void* allocate(XMLSize_t amount);
|
||||
virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type);
|
||||
virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type);
|
||||
virtual XMLCh* cloneString(const XMLCh *src);
|
||||
|
||||
//
|
||||
// Functions to keep track of document mutations, so that node list chached
|
||||
// information can be invalidated. One global changes counter per document.
|
||||
//
|
||||
virtual void changed();
|
||||
virtual int changes() const;
|
||||
|
||||
/**
|
||||
* Sets whether the DOM implementation performs error checking
|
||||
* upon operations. Turning off error checking only affects
|
||||
* the following DOM checks:
|
||||
* <ul>
|
||||
* <li>Checking strings to make sure that all characters are
|
||||
* legal XML characters
|
||||
* <li>Hierarchy checking such as allowed children, checks for
|
||||
* cycles, etc.
|
||||
* </ul>
|
||||
* <p>
|
||||
* Turning off error checking does <em>not</em> turn off the
|
||||
* following checks:
|
||||
* <ul>
|
||||
* <li>Read only checks
|
||||
* <li>Checks related to DOM events
|
||||
* </ul>
|
||||
*/
|
||||
inline void setErrorChecking(bool check) {
|
||||
errorChecking = check;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the DOM implementation performs error checking.
|
||||
*/
|
||||
inline bool getErrorChecking() const {
|
||||
return errorChecking;
|
||||
}
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
virtual DOMNode* importNode(const DOMNode *source, bool deep);
|
||||
virtual DOMElement* createElementNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName);
|
||||
virtual DOMElement* createElementNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
const XMLFileLoc lineNo,
|
||||
const XMLFileLoc columnNo);
|
||||
virtual DOMAttr* createAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName);
|
||||
virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual DOMElement* getElementById(const XMLCh *elementId) const;
|
||||
|
||||
//Introduced in DOM Level 3
|
||||
virtual const XMLCh* getInputEncoding() const;
|
||||
virtual const XMLCh* getXmlEncoding() const;
|
||||
virtual bool getXmlStandalone() const;
|
||||
virtual void setXmlStandalone(bool standalone);
|
||||
virtual const XMLCh* getXmlVersion() const;
|
||||
virtual void setXmlVersion(const XMLCh* version);
|
||||
virtual const XMLCh* getDocumentURI() const;
|
||||
virtual void setDocumentURI(const XMLCh* documentURI);
|
||||
virtual bool getStrictErrorChecking() const;
|
||||
virtual void setStrictErrorChecking(bool strictErrorChecking);
|
||||
virtual DOMNode* adoptNode(DOMNode* source);
|
||||
virtual void normalizeDocument();
|
||||
virtual DOMConfiguration* getDOMConfig() const;
|
||||
|
||||
void setInputEncoding(const XMLCh* actualEncoding);
|
||||
void setXmlEncoding(const XMLCh* encoding);
|
||||
// helper functions to prevent storing userdata pointers on every node.
|
||||
void* setUserData(DOMNodeImpl* n,
|
||||
const XMLCh* key,
|
||||
void* data,
|
||||
DOMUserDataHandler* handler);
|
||||
void* getUserData(const DOMNodeImpl* n,
|
||||
const XMLCh* key) const;
|
||||
void callUserDataHandlers(const DOMNodeImpl* n,
|
||||
DOMUserDataHandler::DOMOperationType operation,
|
||||
const DOMNode* src,
|
||||
DOMNode* dst) const;
|
||||
void transferUserData(DOMNodeImpl* n1, DOMNodeImpl* n2);
|
||||
|
||||
DOMNode* renameNode(DOMNode* n,
|
||||
const XMLCh* namespaceURI,
|
||||
const XMLCh* name);
|
||||
|
||||
//Return the index > 0 of ':' in the given qualified name qName="prefix:localName".
|
||||
//Return 0 if there is no ':', or -1 if qName is malformed such as ":abcd".
|
||||
static int indexofQualifiedName(const XMLCh * qName);
|
||||
static bool isKidOK(DOMNode *parent, DOMNode *child);
|
||||
|
||||
inline DOMNodeIDMap* getNodeIDMap() {return fNodeIDMap;};
|
||||
|
||||
|
||||
//
|
||||
// Memory Management Functions. All memory is allocated by and owned by
|
||||
// a document, and is not recovered until the
|
||||
// document itself is deleted.
|
||||
//
|
||||
const XMLCh* getPooledString(const XMLCh*);
|
||||
const XMLCh* getPooledNString(const XMLCh*, XMLSize_t);
|
||||
void deleteHeap();
|
||||
void releaseDocNotifyUserData(DOMNode* object);
|
||||
void releaseBuffer(DOMBuffer* buffer);
|
||||
DOMBuffer* popBuffer(XMLSize_t nMinSize);
|
||||
MemoryManager* getMemoryManager() const;
|
||||
|
||||
// Factory methods for getting/creating node lists.
|
||||
// Because nothing is ever deleted, the implementation caches and recycles
|
||||
// previously used instances of DOMDeepNodeList
|
||||
//
|
||||
DOMNodeList* getDeepNodeList(const DOMNode *rootNode, const XMLCh *tagName);
|
||||
DOMNodeList* getDeepNodeList(const DOMNode *rootNode, //DOM Level 2
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *localName);
|
||||
|
||||
protected:
|
||||
//Internal helper functions
|
||||
virtual DOMNode* importNode(const DOMNode *source, bool deep, bool cloningNode);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDocumentImpl(const DOMDocumentImpl &);
|
||||
DOMDocumentImpl & operator = (const DOMDocumentImpl &);
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// data
|
||||
// -----------------------------------------------------------------------
|
||||
// New data introduced in DOM Level 3
|
||||
const XMLCh* fInputEncoding;
|
||||
const XMLCh* fXmlEncoding;
|
||||
bool fXmlStandalone;
|
||||
const XMLCh* fXmlVersion;
|
||||
const XMLCh* fDocumentURI;
|
||||
DOMConfiguration* fDOMConfiguration;
|
||||
|
||||
XMLStringPool fUserDataTableKeys;
|
||||
RefHash2KeysTableOf<DOMUserDataRecord, PtrHasher>* fUserDataTable;
|
||||
|
||||
|
||||
// Per-Document heap Variables.
|
||||
// The heap consists of one or more biggish blocks which are
|
||||
// sub-allocated for individual allocations of nodes, strings, etc.
|
||||
// The big blocks form a linked list, allowing them to be located for deletion.
|
||||
//
|
||||
// There is no provision for deleting suballocated blocks, other than
|
||||
// deleting the entire heap when the document is deleted.
|
||||
//
|
||||
// There is no header on individual sub-allocated blocks.
|
||||
// The header on big blocks consists only of a single back pointer to
|
||||
// the previously allocated big block (our linked list of big blocks)
|
||||
//
|
||||
//
|
||||
// revisit - this heap should be encapsulated into its own
|
||||
// class, rather than hanging naked on Document.
|
||||
//
|
||||
void* fCurrentBlock;
|
||||
char* fFreePtr;
|
||||
XMLSize_t fFreeBytesRemaining,
|
||||
fHeapAllocSize;
|
||||
|
||||
// To recycle the DOMNode pointer
|
||||
RefArrayOf<DOMNodePtr>* fRecycleNodePtr;
|
||||
|
||||
// To recycle DOMBuffer pointer
|
||||
RefStackOf<DOMBuffer>* fRecycleBufferPtr;
|
||||
|
||||
// Pool of DOMNodeList for getElementsByTagName
|
||||
DOMDeepNodeListPool<DOMDeepNodeListImpl>* fNodeListPool;
|
||||
|
||||
// Other data
|
||||
DOMDocumentType* fDocType;
|
||||
DOMElement* fDocElement;
|
||||
|
||||
DOMStringPoolEntry** fNameTable;
|
||||
XMLSize_t fNameTableSize;
|
||||
|
||||
DOMNormalizer* fNormalizer;
|
||||
Ranges* fRanges;
|
||||
NodeIterators* fNodeIterators;
|
||||
MemoryManager* fMemoryManager; // configurable memory manager
|
||||
DOMImplementation* fDOMImplementation;
|
||||
|
||||
int fChanges;
|
||||
bool errorChecking; // Bypass error checking.
|
||||
|
||||
};
|
||||
|
||||
inline MemoryManager* DOMDocumentImpl::getMemoryManager() const
|
||||
{
|
||||
return fMemoryManager;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMDocumentImpl::getPooledString(const XMLCh *in)
|
||||
{
|
||||
if (in == 0)
|
||||
return 0;
|
||||
|
||||
DOMStringPoolEntry **pspe;
|
||||
DOMStringPoolEntry *spe;
|
||||
|
||||
XMLSize_t inHash = XMLString::hash(in, fNameTableSize);
|
||||
pspe = &fNameTable[inHash];
|
||||
while (*pspe != 0)
|
||||
{
|
||||
if (XMLString::equals((*pspe)->fString, in))
|
||||
return (*pspe)->fString;
|
||||
pspe = &((*pspe)->fNext);
|
||||
}
|
||||
|
||||
// This string hasn't been seen before. Add it to the pool.
|
||||
//
|
||||
|
||||
// Compute size to allocate. Note that there's 1 char of string
|
||||
// declared in the struct, so we don't need to add one again to
|
||||
// account for the trailing null.
|
||||
//
|
||||
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + XMLString::stringLen(in)*sizeof(XMLCh);
|
||||
*pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate);
|
||||
spe->fNext = 0;
|
||||
XMLString::copyString((XMLCh*)spe->fString, in);
|
||||
|
||||
return spe->fString;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMDocumentImpl::
|
||||
getPooledNString(const XMLCh *in, XMLSize_t n)
|
||||
{
|
||||
if (in == 0)
|
||||
return 0;
|
||||
|
||||
DOMStringPoolEntry **pspe;
|
||||
DOMStringPoolEntry *spe;
|
||||
|
||||
XMLSize_t inHash = XMLString::hashN(in, n, fNameTableSize);
|
||||
pspe = &fNameTable[inHash];
|
||||
while (*pspe != 0)
|
||||
{
|
||||
if (XMLString::equalsN((*pspe)->fString, in, n))
|
||||
return (*pspe)->fString;
|
||||
pspe = &((*pspe)->fNext);
|
||||
}
|
||||
|
||||
// This string hasn't been seen before. Add it to the pool.
|
||||
//
|
||||
|
||||
// Compute size to allocate. Note that there's 1 char of string
|
||||
// declared in the struct, so we don't need to add one again to
|
||||
// account for the trailing null.
|
||||
//
|
||||
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + n*sizeof(XMLCh);
|
||||
*pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate);
|
||||
spe->fNext = 0;
|
||||
XMLString::copyNString((XMLCh*)spe->fString, in, n);
|
||||
|
||||
return spe->fString;
|
||||
}
|
||||
|
||||
inline int DOMDocumentImpl::indexofQualifiedName(const XMLCh* name)
|
||||
{
|
||||
int i = 0;
|
||||
int colon = -1;
|
||||
int colon_count = 0;
|
||||
for (; *name != 0; ++i, ++name)
|
||||
{
|
||||
if (*name == chColon)
|
||||
{
|
||||
++colon_count;
|
||||
colon = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0 || colon == 0 || colon == (i - 1) || colon_count > 1)
|
||||
return -1;
|
||||
|
||||
return colon != -1 ? colon : 0;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// Operator new. Global overloaded version, lets any object be allocated on
|
||||
// the heap owned by a document.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type)
|
||||
{
|
||||
void *p = doc->allocate(amt, type);
|
||||
return p;
|
||||
}
|
||||
|
||||
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type)
|
||||
{
|
||||
XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
|
||||
void* p=0;
|
||||
if(mgr)
|
||||
p = mgr->allocate(amt, type);
|
||||
return p;
|
||||
}
|
||||
|
||||
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc)
|
||||
{
|
||||
void* p = doc->allocate(amt);
|
||||
return p;
|
||||
}
|
||||
|
||||
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
|
||||
{
|
||||
XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
|
||||
void* p=0;
|
||||
if(mgr)
|
||||
p = mgr->allocate(amt);
|
||||
return p;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// For DOM:
|
||||
// Bypass compiler warning:
|
||||
// no matching operator delete found; memory will not be freed if initialization throws an exception
|
||||
// ---------------------------------------------------------------------------
|
||||
#if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR)
|
||||
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMDocumentTypeImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMDocumentType.hpp>
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMParentNode.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNamedNodeMapImpl;
|
||||
|
||||
class CDOM_EXPORT DOMDocumentTypeImpl: public DOMDocumentType {
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
DOMChildNode fChild;
|
||||
|
||||
const XMLCh * fName;
|
||||
DOMNamedNodeMapImpl* fEntities;
|
||||
DOMNamedNodeMapImpl* fNotations;
|
||||
DOMNamedNodeMapImpl* fElements;
|
||||
const XMLCh * fPublicId;
|
||||
const XMLCh * fSystemId;
|
||||
const XMLCh * fInternalSubset;
|
||||
|
||||
bool fIntSubsetReading;
|
||||
bool fIsCreatedFromHeap;
|
||||
|
||||
virtual void setPublicId(const XMLCh * value);
|
||||
virtual void setSystemId(const XMLCh * value);
|
||||
virtual void setInternalSubset(const XMLCh *value);
|
||||
bool isIntSubsetReading() const;
|
||||
|
||||
friend class AbstractDOMParser;
|
||||
friend class DOMDocumentImpl;
|
||||
|
||||
public:
|
||||
DOMDocumentTypeImpl(DOMDocument *, const XMLCh *, bool);
|
||||
DOMDocumentTypeImpl(DOMDocument *,
|
||||
const XMLCh *qualifiedName, //DOM Level 2
|
||||
const XMLCh *publicId, const XMLCh *systemId, bool);
|
||||
DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep=false);
|
||||
virtual ~DOMDocumentTypeImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
virtual void setOwnerDocument(DOMDocument *doc);
|
||||
virtual DOMNamedNodeMap * getEntities() const;
|
||||
virtual const XMLCh * getName() const;
|
||||
virtual DOMNamedNodeMap * getNotations() const;
|
||||
virtual DOMNamedNodeMap * getElements() const;
|
||||
virtual void setReadOnly(bool readOnly, bool deep);
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
|
||||
virtual const XMLCh * getPublicId() const;
|
||||
virtual const XMLCh * getSystemId() const;
|
||||
virtual const XMLCh * getInternalSubset() const;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMDocumentTypeImpl & operator = (const DOMDocumentTypeImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMElementImpl.hpp 792236 2009-07-08 17:22:35Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
#include <xercesc/dom/DOMElement.hpp>
|
||||
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMParentNode.hpp"
|
||||
|
||||
#include "DOMAttrMapImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMTypeInfo;
|
||||
class DOMNodeList;
|
||||
class DOMAttrMapImpl;
|
||||
class DOMDocument;
|
||||
|
||||
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMElementImpl: public DOMElement {
|
||||
public:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
DOMChildNode fChild;
|
||||
DOMAttrMapImpl *fAttributes;
|
||||
DOMAttrMapImpl *fDefaultAttributes;
|
||||
const XMLCh *fName;
|
||||
|
||||
public:
|
||||
DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *name);
|
||||
|
||||
DOMElementImpl(const DOMElementImpl &other, bool deep=false);
|
||||
virtual ~DOMElementImpl();
|
||||
|
||||
public:
|
||||
// Declare functions from DOMNode. They all must be implemented by this class
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// Functions introduced on Element...
|
||||
virtual const XMLCh* getAttribute(const XMLCh *name) const;
|
||||
virtual DOMAttr* getAttributeNode(const XMLCh *name) const;
|
||||
virtual DOMNodeList* getElementsByTagName(const XMLCh *tagname) const;
|
||||
virtual const XMLCh* getTagName() const;
|
||||
virtual void removeAttribute(const XMLCh *name);
|
||||
virtual DOMAttr* removeAttributeNode(DOMAttr * oldAttr);
|
||||
virtual void setAttribute(const XMLCh *name, const XMLCh *value);
|
||||
virtual DOMAttr* setAttributeNode(DOMAttr *newAttr);
|
||||
virtual void setReadOnly(bool readOnly, bool deep);
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
virtual const XMLCh* getAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual void setAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
const XMLCh *value);
|
||||
virtual void removeAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName);
|
||||
virtual DOMAttr* getAttributeNodeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual DOMAttr* setAttributeNodeNS(DOMAttr *newAttr);
|
||||
virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual bool hasAttribute(const XMLCh *name) const;
|
||||
virtual bool hasAttributeNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
|
||||
//Introduced in DOM level 3
|
||||
virtual void setIdAttribute(const XMLCh* name, bool isId);
|
||||
virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId);
|
||||
virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId);
|
||||
virtual const DOMTypeInfo * getSchemaTypeInfo() const;
|
||||
|
||||
// for handling of default attribute
|
||||
virtual DOMAttr* setDefaultAttributeNode(DOMAttr *newAttr);
|
||||
virtual DOMAttr* setDefaultAttributeNodeNS(DOMAttr *newAttr);
|
||||
virtual DOMAttrMapImpl* getDefaultAttributes() const;
|
||||
|
||||
// helper function for DOM Level 3 renameNode
|
||||
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
|
||||
// DOMElementTraversal
|
||||
virtual DOMElement * getFirstElementChild() const;
|
||||
virtual DOMElement * getLastElementChild() const;
|
||||
virtual DOMElement * getPreviousElementSibling() const;
|
||||
virtual DOMElement * getNextElementSibling() const;
|
||||
virtual XMLSize_t getChildElementCount() const;
|
||||
|
||||
protected:
|
||||
// default attribute helper functions
|
||||
virtual void setupDefaultAttributes();
|
||||
|
||||
// helper function for DOMElementTraversal methods
|
||||
DOMElement* getFirstElementChild(const DOMNode* n) const;
|
||||
DOMElement* getLastElementChild(const DOMNode* n) const;
|
||||
DOMNode* getNextLogicalSibling(const DOMNode* n) const;
|
||||
DOMNode* getPreviousLogicalSibling(const DOMNode* n) const;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMElementImpl & operator = (const DOMElementImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMElementNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include "DOMElementImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMTypeInfoImpl;
|
||||
|
||||
class CDOM_EXPORT DOMElementNSImpl: public DOMElementImpl {
|
||||
protected:
|
||||
//Introduced in DOM Level 2
|
||||
const XMLCh * fNamespaceURI; //namespace URI of this node
|
||||
const XMLCh * fLocalName; //local part of qualified name
|
||||
const XMLCh * fPrefix;
|
||||
const DOMTypeInfoImpl *fSchemaType;
|
||||
|
||||
public:
|
||||
DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
|
||||
DOMElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName);
|
||||
DOMElementNSImpl(const DOMElementNSImpl &other, bool deep=false);
|
||||
|
||||
// Fast construction without any checks for name validity. Used in
|
||||
// parsing.
|
||||
//
|
||||
DOMElementNSImpl(DOMDocument *ownerDoc,
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *prefix, // Null or empty - no prefix.
|
||||
const XMLCh *localName,
|
||||
const XMLCh *qualifiedName);
|
||||
|
||||
virtual DOMNode * cloneNode(bool deep) const;
|
||||
virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const;
|
||||
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const;
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
virtual const XMLCh *getNamespaceURI() const;
|
||||
virtual const XMLCh *getPrefix() const;
|
||||
virtual const XMLCh *getLocalName() const;
|
||||
virtual void setPrefix(const XMLCh *prefix);
|
||||
virtual void release();
|
||||
|
||||
//Introduced in DOM Level 3
|
||||
virtual const DOMTypeInfo * getSchemaTypeInfo() const;
|
||||
|
||||
// helper function for DOM Level 3 renameNode
|
||||
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
void setName(const XMLCh* namespaceURI, const XMLCh* name);
|
||||
|
||||
//helper function for DOM Level 3 TypeInfo
|
||||
virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMElementNSImpl & operator = (const DOMElementNSImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMEntityImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMParentNode.hpp"
|
||||
#include <xercesc/dom/DOMEntity.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMEntityReference;
|
||||
|
||||
class CDOM_EXPORT DOMEntityImpl: public DOMEntity {
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
|
||||
const XMLCh * fName;
|
||||
const XMLCh * fPublicId;
|
||||
const XMLCh * fSystemId;
|
||||
const XMLCh * fNotationName;
|
||||
DOMEntityReference* fRefEntity;
|
||||
|
||||
// New data introduced in DOM Level 3
|
||||
const XMLCh* fInputEncoding;
|
||||
const XMLCh* fXmlEncoding;
|
||||
const XMLCh* fXmlVersion;
|
||||
const XMLCh* fBaseURI;
|
||||
bool fEntityRefNodeCloned;
|
||||
|
||||
// helper function
|
||||
void cloneEntityRefTree() const;
|
||||
|
||||
friend class XercesDOMParser;
|
||||
|
||||
public:
|
||||
DOMEntityImpl(DOMDocument *doc, const XMLCh *eName);
|
||||
DOMEntityImpl(const DOMEntityImpl &other, bool deep=false);
|
||||
virtual ~DOMEntityImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
virtual const XMLCh * getPublicId() const;
|
||||
virtual const XMLCh * getSystemId() const;
|
||||
virtual const XMLCh * getNotationName() const;
|
||||
virtual void setNotationName(const XMLCh *arg);
|
||||
virtual void setPublicId(const XMLCh *arg);
|
||||
virtual void setSystemId(const XMLCh *arg);
|
||||
|
||||
//DOM Level 2 additions. Non standard functions
|
||||
virtual void setEntityRef(DOMEntityReference *);
|
||||
virtual DOMEntityReference* getEntityRef() const;
|
||||
|
||||
//Introduced in DOM Level 3
|
||||
virtual const XMLCh* getInputEncoding() const;
|
||||
virtual const XMLCh* getXmlEncoding() const;
|
||||
virtual const XMLCh* getXmlVersion() const;
|
||||
virtual void setBaseURI(const XMLCh *arg);
|
||||
|
||||
void setInputEncoding(const XMLCh* actualEncoding);
|
||||
void setXmlEncoding(const XMLCh* encoding);
|
||||
void setXmlVersion(const XMLCh* version);
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMEntityImpl & operator = (const DOMEntityImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMEntityReferenceImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMEntityReference.hpp>
|
||||
|
||||
#include "DOMParentNode.hpp"
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMEntityReferenceImpl: public DOMEntityReference
|
||||
{
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMParentNode fParent;
|
||||
DOMChildNode fChild;
|
||||
|
||||
const XMLCh *fName;
|
||||
const XMLCh *fBaseURI;
|
||||
|
||||
friend class XercesDOMParser;
|
||||
|
||||
public:
|
||||
DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName);
|
||||
DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName, bool cloneChild);
|
||||
DOMEntityReferenceImpl(const DOMEntityReferenceImpl &other, bool deep=false);
|
||||
virtual ~DOMEntityReferenceImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
virtual void setReadOnly(bool readOnly,bool deep);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMEntityReferenceImpl & operator = (const DOMEntityReferenceImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMErrorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP
|
||||
|
||||
#include <xercesc/dom/DOMError.hpp>
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Introduced in DOM Level 3
|
||||
* Implementation of a DOMError interface.
|
||||
*
|
||||
* @see DOMError#DOMError
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMErrorImpl : public DOMError
|
||||
{
|
||||
public:
|
||||
/** @name Constructors and Destructor */
|
||||
//@{
|
||||
|
||||
/** Constructors */
|
||||
DOMErrorImpl(const ErrorSeverity severity);
|
||||
|
||||
DOMErrorImpl
|
||||
(
|
||||
const ErrorSeverity severity
|
||||
, const XMLCh* const message
|
||||
, DOMLocator* const location
|
||||
);
|
||||
|
||||
DOMErrorImpl
|
||||
(
|
||||
const ErrorSeverity severity
|
||||
, const XMLCh* type
|
||||
, const XMLCh* message
|
||||
, void* relatedData
|
||||
);
|
||||
|
||||
/** Desctructor */
|
||||
virtual ~DOMErrorImpl();
|
||||
|
||||
//@}
|
||||
|
||||
// DOMError interface
|
||||
virtual ErrorSeverity getSeverity() const;
|
||||
virtual const XMLCh* getMessage() const;
|
||||
virtual DOMLocator* getLocation() const;
|
||||
virtual void* getRelatedException() const;
|
||||
virtual const XMLCh* getType() const;
|
||||
virtual void* getRelatedData() const;
|
||||
|
||||
// Setters
|
||||
void setSeverity(const ErrorSeverity severity);
|
||||
void setMessage(const XMLCh* const message);
|
||||
void setLocation(DOMLocator* const location);
|
||||
void setAdoptLocation(const bool value);
|
||||
void setRelatedException(void* exc) const;
|
||||
void setType(const XMLCh* type);
|
||||
void setRelatedData(void* relatedData);
|
||||
|
||||
private:
|
||||
/* Unimplemented constructors and operators */
|
||||
|
||||
/* Copy constructor */
|
||||
DOMErrorImpl(const DOMErrorImpl&);
|
||||
|
||||
/* Assignment operator */
|
||||
DOMErrorImpl& operator=(const DOMErrorImpl&);
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fAdoptLocation
|
||||
// Indicates whether we own the DOMLocator object or not.
|
||||
//
|
||||
// fSeverity
|
||||
// The type of the error.
|
||||
//
|
||||
// fMessage
|
||||
// The error message.
|
||||
//
|
||||
// fLocation
|
||||
// The location info of the error.
|
||||
//
|
||||
// fType
|
||||
// The type of the error.
|
||||
//
|
||||
// fRelatedData
|
||||
// The data related to this error.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
bool fAdoptLocation;
|
||||
ErrorSeverity fSeverity;
|
||||
const XMLCh* fMessage;
|
||||
DOMLocator* fLocation;
|
||||
const XMLCh* fType;
|
||||
void* fRelatedData;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DOMErrorImpl: Getter methods
|
||||
// ---------------------------------------------------------------------------
|
||||
inline DOMError::ErrorSeverity DOMErrorImpl::getSeverity() const
|
||||
{
|
||||
return fSeverity;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMErrorImpl::getMessage() const
|
||||
{
|
||||
return fMessage;
|
||||
}
|
||||
|
||||
inline DOMLocator* DOMErrorImpl::getLocation() const
|
||||
{
|
||||
return fLocation;
|
||||
}
|
||||
|
||||
inline void* DOMErrorImpl::getRelatedException() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMErrorImpl::getType() const
|
||||
{
|
||||
return fType;
|
||||
}
|
||||
|
||||
inline void* DOMErrorImpl::getRelatedData() const
|
||||
{
|
||||
return fRelatedData;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DOMErrorImpl: Setter methods
|
||||
// ---------------------------------------------------------------------------
|
||||
inline void DOMErrorImpl::setSeverity(const ErrorSeverity severity)
|
||||
{
|
||||
fSeverity = severity;
|
||||
}
|
||||
|
||||
inline void DOMErrorImpl::setMessage(const XMLCh* const message)
|
||||
{
|
||||
fMessage = message;
|
||||
}
|
||||
|
||||
inline void DOMErrorImpl::setAdoptLocation(const bool value)
|
||||
{
|
||||
fAdoptLocation = value;
|
||||
}
|
||||
|
||||
inline void DOMErrorImpl::setType(const XMLCh* type)
|
||||
{
|
||||
fType = type;
|
||||
}
|
||||
|
||||
inline void DOMErrorImpl::setRelatedData(void* relatedData)
|
||||
{
|
||||
fRelatedData = relatedData;
|
||||
}
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMImplementation.hpp>
|
||||
#include <xercesc/dom/DOMImplementationSource.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class XMLMsgLoader;
|
||||
|
||||
class DOMImplementationImpl: public XMemory,
|
||||
public DOMImplementation,
|
||||
public DOMImplementationSource
|
||||
{
|
||||
private:
|
||||
DOMImplementationImpl(const DOMImplementationImpl &);
|
||||
DOMImplementationImpl & operator = (const DOMImplementationImpl &);
|
||||
friend class XMLInitializer;
|
||||
|
||||
protected:
|
||||
DOMImplementationImpl() {};
|
||||
|
||||
public:
|
||||
virtual ~DOMImplementationImpl() {};
|
||||
static DOMImplementationImpl* getDOMImplementationImpl();
|
||||
static XMLMsgLoader* getMsgLoader4DOM();
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// DOMImplementation Virtual interface
|
||||
// ------------------------------------------------------------
|
||||
virtual bool hasFeature(const XMLCh * feature, const XMLCh * version) const;
|
||||
|
||||
// Introduced in DOM Level 2
|
||||
virtual DOMDocumentType* createDocumentType(const XMLCh *qualifiedName,
|
||||
const XMLCh * publicId,
|
||||
const XMLCh *systemId);
|
||||
virtual DOMDocument* createDocument(const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
DOMDocumentType *doctype,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
// DOM Level 3
|
||||
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const;
|
||||
|
||||
// Non-standard extension
|
||||
virtual DOMDocument* createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// DOMImplementationLS Virtual interface
|
||||
// ------------------------------------------------------------
|
||||
// Introduced in DOM Level 3
|
||||
virtual DOMLSParser* createLSParser(const DOMImplementationLSMode mode,
|
||||
const XMLCh* const schemaType,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager,
|
||||
XMLGrammarPool* const gramPool = 0);
|
||||
virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// DOMImplementationSource Virtual interface
|
||||
// ------------------------------------------------------------
|
||||
virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const;
|
||||
virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMImplementationListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
#include <xercesc/dom/DOMImplementationList.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMImplementation;
|
||||
|
||||
class CDOM_EXPORT DOMImplementationListImpl: public DOMImplementationList
|
||||
{
|
||||
protected:
|
||||
RefVectorOf<DOMImplementation> *fList;
|
||||
|
||||
private:
|
||||
// Unused, and unimplemented constructors, operators, etc.
|
||||
DOMImplementationListImpl(const DOMImplementationListImpl & other);
|
||||
DOMImplementationListImpl & operator = (const DOMImplementationListImpl & other);
|
||||
|
||||
public:
|
||||
DOMImplementationListImpl();
|
||||
void add(DOMImplementation* impl);
|
||||
|
||||
virtual ~DOMImplementationListImpl();
|
||||
virtual DOMImplementation * item(XMLSize_t index) const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual void release();
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSInputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP
|
||||
|
||||
#include <xercesc/dom/DOM.hpp>
|
||||
#include <xercesc/dom/DOMLSInput.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class CDOM_EXPORT DOMLSInputImpl : public XMemory, public DOMLSInput
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
DOMLSInputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMLSInputImpl();
|
||||
|
||||
virtual const XMLCh* getStringData() const;
|
||||
virtual InputSource* getByteStream() const;
|
||||
virtual const XMLCh* getEncoding() const;
|
||||
virtual const XMLCh* getPublicId() const;
|
||||
virtual const XMLCh* getSystemId() const;
|
||||
virtual const XMLCh* getBaseURI() const;
|
||||
|
||||
virtual void setStringData(const XMLCh* data);
|
||||
virtual void setByteStream(InputSource* stream);
|
||||
virtual void setEncoding(const XMLCh* const encodingStr);
|
||||
virtual void setPublicId(const XMLCh* const publicId);
|
||||
virtual void setSystemId(const XMLCh* const systemId);
|
||||
virtual void setBaseURI(const XMLCh* const baseURI);
|
||||
|
||||
virtual void setIssueFatalErrorIfNotFound(bool flag);
|
||||
virtual bool getIssueFatalErrorIfNotFound() const;
|
||||
virtual void release();
|
||||
|
||||
|
||||
private:
|
||||
/** unimplemented copy ctor and assignment operator */
|
||||
DOMLSInputImpl(const DOMLSInputImpl&);
|
||||
DOMLSInputImpl & operator = (const DOMLSInputImpl&);
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fStringData
|
||||
// We don't own it
|
||||
//
|
||||
// fByteStream
|
||||
// We don't own it
|
||||
//
|
||||
// fEncoding
|
||||
// We own it
|
||||
//
|
||||
// fPublicId
|
||||
// We own it
|
||||
//
|
||||
// fSystemId
|
||||
// We own it
|
||||
//
|
||||
// fBaseURI
|
||||
// We own it
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
const XMLCh *fStringData;
|
||||
InputSource *fByteStream;
|
||||
XMLCh *fEncoding;
|
||||
XMLCh *fPublicId;
|
||||
XMLCh *fSystemId;
|
||||
XMLCh *fBaseURI;
|
||||
bool fIssueFatalErrorIfNotFound;
|
||||
MemoryManager* fMemoryManager;
|
||||
};
|
||||
|
||||
inline const XMLCh* DOMLSInputImpl::getStringData() const
|
||||
{
|
||||
return fStringData;
|
||||
}
|
||||
|
||||
inline InputSource* DOMLSInputImpl::getByteStream() const
|
||||
{
|
||||
return fByteStream;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSInputImpl::getEncoding() const
|
||||
{
|
||||
return fEncoding;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSInputImpl::getPublicId() const
|
||||
{
|
||||
return fPublicId;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSInputImpl::getSystemId() const
|
||||
{
|
||||
return fSystemId;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSInputImpl::getBaseURI() const
|
||||
{
|
||||
return fBaseURI;
|
||||
}
|
||||
|
||||
inline bool DOMLSInputImpl::getIssueFatalErrorIfNotFound() const
|
||||
{
|
||||
return fIssueFatalErrorIfNotFound;
|
||||
}
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSOutputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP
|
||||
|
||||
#include <xercesc/dom/DOM.hpp>
|
||||
#include <xercesc/dom/DOMLSOutput.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class CDOM_EXPORT DOMLSOutputImpl : public XMemory, public DOMLSOutput
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
DOMLSOutputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMLSOutputImpl();
|
||||
|
||||
virtual XMLFormatTarget* getByteStream() const;
|
||||
virtual const XMLCh* getEncoding() const;
|
||||
virtual const XMLCh* getSystemId() const;
|
||||
|
||||
virtual void setByteStream(XMLFormatTarget* stream);
|
||||
virtual void setEncoding(const XMLCh* const encodingStr);
|
||||
virtual void setSystemId(const XMLCh* const systemId);
|
||||
|
||||
virtual void release();
|
||||
|
||||
private:
|
||||
|
||||
/** unimplemented copy ctor and assignment operator */
|
||||
DOMLSOutputImpl(const DOMLSOutputImpl&);
|
||||
DOMLSOutputImpl & operator = (const DOMLSOutputImpl&);
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fByteStream
|
||||
// We don't own it
|
||||
//
|
||||
// fEncoding
|
||||
// We own it
|
||||
//
|
||||
// fSystemId
|
||||
// We own it
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
XMLFormatTarget *fByteStream;
|
||||
XMLCh *fEncoding;
|
||||
XMLCh *fSystemId;
|
||||
MemoryManager* fMemoryManager;
|
||||
};
|
||||
|
||||
inline XMLFormatTarget* DOMLSOutputImpl::getByteStream() const
|
||||
{
|
||||
return fByteStream;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSOutputImpl::getEncoding() const
|
||||
{
|
||||
return fEncoding;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLSOutputImpl::getSystemId() const
|
||||
{
|
||||
return fSystemId;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,232 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLSSerializerImpl.hpp 695856 2008-09-16 12:52:32Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP
|
||||
|
||||
#include <xercesc/dom/DOM.hpp>
|
||||
#include <xercesc/dom/DOMLSSerializer.hpp>
|
||||
#include <xercesc/util/XMLDOMMsg.hpp>
|
||||
#include <xercesc/util/RefHashTableOf.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
#include <xercesc/framework/XMLFormatter.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMStringListImpl;
|
||||
|
||||
class CDOM_EXPORT DOMLSSerializerImpl : public XMemory,
|
||||
public DOMLSSerializer,
|
||||
public DOMConfiguration
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
/** @name Constructor and Destructor */
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
DOMLSSerializerImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~DOMLSSerializerImpl();
|
||||
//@}
|
||||
|
||||
/** @name Implementation of DOMLSSerializer interface */
|
||||
//@{
|
||||
|
||||
virtual DOMConfiguration* getDomConfig();
|
||||
|
||||
virtual void setNewLine(const XMLCh* const newLine);
|
||||
virtual const XMLCh* getNewLine() const;
|
||||
|
||||
virtual void setFilter(DOMLSSerializerFilter *filter);
|
||||
virtual DOMLSSerializerFilter* getFilter() const;
|
||||
|
||||
virtual bool write(const DOMNode* nodeToWrite,
|
||||
DOMLSOutput* const destination);
|
||||
virtual bool writeToURI(const DOMNode* nodeToWrite,
|
||||
const XMLCh* uri);
|
||||
/**
|
||||
* The caller is responsible for the release of the returned string
|
||||
*/
|
||||
virtual XMLCh* writeToString(const DOMNode* nodeToWrite, MemoryManager* manager = NULL);
|
||||
virtual void release();
|
||||
|
||||
//@}
|
||||
|
||||
/** @name Implementation of DOMConfiguration interface */
|
||||
//@{
|
||||
virtual void setParameter(const XMLCh* name, const void* value);
|
||||
virtual void setParameter(const XMLCh* name, bool value);
|
||||
virtual const void* getParameter(const XMLCh* name) const;
|
||||
virtual bool canSetParameter(const XMLCh* name, const void* value) const;
|
||||
virtual bool canSetParameter(const XMLCh* name, bool value) const;
|
||||
virtual const DOMStringList* getParameterNames() const;
|
||||
//@}
|
||||
|
||||
private:
|
||||
|
||||
/** unimplemented copy ctor and assignment operator */
|
||||
DOMLSSerializerImpl(const DOMLSSerializerImpl&);
|
||||
DOMLSSerializerImpl & operator = (const DOMLSSerializerImpl&);
|
||||
|
||||
protected:
|
||||
/** helper **/
|
||||
void processNode(const DOMNode* const);
|
||||
|
||||
void procCdataSection(const XMLCh* const nodeValue
|
||||
, const DOMNode* const nodeToWrite);
|
||||
|
||||
void procUnrepCharInCdataSection(const XMLCh* const nodeValue
|
||||
, const DOMNode* const nodeToWrite);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Overidden by derived classes to extend the abilities of the standard writer
|
||||
* always returns false in the default implementation
|
||||
* @return true if the method deals with nodeToWrite
|
||||
*/
|
||||
virtual bool customNodeSerialize(const DOMNode* const nodeToWrite, int level);
|
||||
|
||||
DOMNodeFilter::FilterAction checkFilter(const DOMNode* const) const;
|
||||
|
||||
bool checkFeature(const XMLCh* const featName
|
||||
, bool state
|
||||
, int& featureId) const;
|
||||
|
||||
bool reportError(const DOMNode* const errorNode
|
||||
, DOMError::ErrorSeverity errorType
|
||||
, const XMLCh* const errorMsg);
|
||||
bool reportError(const DOMNode* const errorNode
|
||||
, DOMError::ErrorSeverity errorType
|
||||
, XMLDOMMsg::Codes toEmit);
|
||||
|
||||
bool canSetFeature(const int featureId
|
||||
, bool val) const;
|
||||
void setFeature(const int featureId
|
||||
, bool val);
|
||||
bool getFeature(const int featureId) const;
|
||||
|
||||
void printNewLine();
|
||||
void setURCharRef();
|
||||
bool isDefaultNamespacePrefixDeclared() const;
|
||||
bool isNamespaceBindingActive(const XMLCh* prefix, const XMLCh* uri) const;
|
||||
|
||||
|
||||
void printIndent(unsigned int level);
|
||||
//does the actual work for processNode while keeping track of the level
|
||||
void processNode(const DOMNode* const nodeToWrite, int level);
|
||||
|
||||
void processBOM();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fFeatures
|
||||
//
|
||||
// fNewLine
|
||||
// own it
|
||||
//
|
||||
// fErrorHandler
|
||||
// don't own it
|
||||
//
|
||||
// fFilter
|
||||
// don't own it
|
||||
//
|
||||
// fDocumentVersion
|
||||
// The XML Version of the document to be serialized.
|
||||
//
|
||||
// fSupportedParameters
|
||||
// A list of the parameters that can be set, including the ones
|
||||
// specific of Xerces
|
||||
//
|
||||
// fEncodingUsed (session var)
|
||||
// the actual encoding used in write(),
|
||||
// it does not own any data(memory).
|
||||
//
|
||||
// fNewLineUsed (session var)
|
||||
// the actual "end of line" sequence used in write(),
|
||||
// it does not own any data(memory).
|
||||
//
|
||||
// fFormatter (session var)
|
||||
// the formatter used in write()
|
||||
//
|
||||
// fErrorCount
|
||||
// the count of error encountered in the serialization,
|
||||
// which neither the error handler, nor the serializer itself,
|
||||
// treat as fatal. And the serializer will return true/false
|
||||
// based on this value.
|
||||
//
|
||||
// fCurrentLine
|
||||
// the current line. Used to track the line number the current
|
||||
// node begins on
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
int fFeatures;
|
||||
XMLCh *fNewLine;
|
||||
DOMErrorHandler *fErrorHandler;
|
||||
DOMLSSerializerFilter *fFilter;
|
||||
const XMLCh *fDocumentVersion;
|
||||
DOMStringListImpl *fSupportedParameters;
|
||||
|
||||
//session vars
|
||||
const XMLCh *fEncodingUsed;
|
||||
const XMLCh *fNewLineUsed;
|
||||
XMLFormatter *fFormatter;
|
||||
int fErrorCount;
|
||||
int fCurrentLine;
|
||||
bool fLineFeedInTextNodePrinted;
|
||||
unsigned int fLastWhiteSpaceInTextNode;
|
||||
|
||||
RefVectorOf< RefHashTableOf<XMLCh> >* fNamespaceStack;
|
||||
MemoryManager* fMemoryManager;
|
||||
};
|
||||
|
||||
inline DOMConfiguration* DOMLSSerializerImpl::getDomConfig()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
inline void DOMLSSerializerImpl::setFeature(const int featureId
|
||||
, bool val)
|
||||
{
|
||||
(val)? fFeatures |= (1<<featureId) : fFeatures &= ~(1<<featureId);
|
||||
}
|
||||
|
||||
inline bool DOMLSSerializerImpl::getFeature(const int featureId) const
|
||||
{
|
||||
return ((fFeatures & ( 1<<featureId )) != 0) ? true : false;
|
||||
}
|
||||
|
||||
inline void DOMLSSerializerImpl::setURCharRef()
|
||||
{
|
||||
fFormatter->setUnRepFlags(XMLFormatter::UnRep_CharRef);
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,187 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMLocatorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP
|
||||
|
||||
#include <xercesc/dom/DOMLocator.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* Introduced in DOM Level 3
|
||||
*
|
||||
* Implementation of a DOMLocator interface.
|
||||
*
|
||||
* @see DOMLocator#DOMLocator
|
||||
*/
|
||||
|
||||
class CDOM_EXPORT DOMLocatorImpl : public DOMLocator
|
||||
{
|
||||
public:
|
||||
/** @name Constructors and Destructor */
|
||||
//@{
|
||||
|
||||
/** Constructor */
|
||||
DOMLocatorImpl();
|
||||
|
||||
DOMLocatorImpl
|
||||
(
|
||||
const XMLFileLoc lineNum
|
||||
, const XMLFileLoc columnNum
|
||||
, DOMNode* const errorNode
|
||||
, const XMLCh* const uri
|
||||
, const XMLFilePos offset = ~(XMLFilePos(0))
|
||||
, const XMLFilePos utf16Offset = ~(XMLFilePos(0))
|
||||
);
|
||||
|
||||
/** Desctructor */
|
||||
virtual ~DOMLocatorImpl();
|
||||
|
||||
//@}
|
||||
|
||||
// DOMLocator interface
|
||||
virtual XMLFileLoc getLineNumber() const;
|
||||
virtual XMLFileLoc getColumnNumber() const;
|
||||
virtual XMLFilePos getByteOffset() const;
|
||||
virtual XMLFilePos getUtf16Offset() const;
|
||||
virtual DOMNode* getRelatedNode() const;
|
||||
virtual const XMLCh* getURI() const;
|
||||
|
||||
// Setter functions
|
||||
void setLineNumber(const XMLFileLoc lineNumber);
|
||||
void setColumnNumber(const XMLFileLoc columnNumber);
|
||||
void setByteOffset(const XMLFilePos offset);
|
||||
void setUtf16Offset(const XMLFilePos offset);
|
||||
void setRelatedNode(DOMNode* const errorNode);
|
||||
void setURI(const XMLCh* const uri);
|
||||
|
||||
|
||||
private :
|
||||
/* Unimplemented constructors and operators */
|
||||
|
||||
/* Copy constructor */
|
||||
DOMLocatorImpl(const DOMLocatorImpl&);
|
||||
|
||||
/* Assignment operator */
|
||||
DOMLocatorImpl& operator=(const DOMLocatorImpl&);
|
||||
|
||||
protected:
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fLineNum
|
||||
// fColumnNum
|
||||
// Track line/column number of where the error occured
|
||||
//
|
||||
// fByteOffset
|
||||
// Track byte offset in the input source where the error
|
||||
// occured
|
||||
//
|
||||
// fUtf16Offset
|
||||
// Track character offset in the input source where the error
|
||||
// occured
|
||||
//
|
||||
// fRelatedNode
|
||||
// Current node where the error occured
|
||||
//
|
||||
// fURI
|
||||
// The uri where the error occured
|
||||
// -----------------------------------------------------------------------
|
||||
XMLFileLoc fLineNum;
|
||||
XMLFileLoc fColumnNum;
|
||||
XMLFilePos fByteOffset;
|
||||
XMLFilePos fUtf16Offset;
|
||||
DOMNode* fRelatedNode;
|
||||
const XMLCh* fURI;
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DOMLocatorImpl: Getter methods
|
||||
// ---------------------------------------------------------------------------
|
||||
inline XMLFileLoc DOMLocatorImpl::getLineNumber() const
|
||||
{
|
||||
return fLineNum;
|
||||
}
|
||||
|
||||
inline XMLFileLoc DOMLocatorImpl::getColumnNumber() const
|
||||
{
|
||||
return fColumnNum;
|
||||
}
|
||||
|
||||
inline XMLFilePos DOMLocatorImpl::getByteOffset() const
|
||||
{
|
||||
return fByteOffset;
|
||||
}
|
||||
|
||||
inline XMLFilePos DOMLocatorImpl::getUtf16Offset() const
|
||||
{
|
||||
return fUtf16Offset;
|
||||
}
|
||||
|
||||
inline DOMNode* DOMLocatorImpl::getRelatedNode() const
|
||||
{
|
||||
return fRelatedNode;
|
||||
}
|
||||
|
||||
inline const XMLCh* DOMLocatorImpl::getURI() const
|
||||
{
|
||||
return fURI;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DOMLocatorImpl: Setter methods
|
||||
// ---------------------------------------------------------------------------
|
||||
inline void DOMLocatorImpl::setLineNumber(const XMLFileLoc lineNumber)
|
||||
{
|
||||
fLineNum = lineNumber;
|
||||
}
|
||||
|
||||
inline void DOMLocatorImpl::setColumnNumber(const XMLFileLoc columnNumber)
|
||||
{
|
||||
fColumnNum = columnNumber;
|
||||
}
|
||||
|
||||
inline void DOMLocatorImpl::setByteOffset(const XMLFilePos offset)
|
||||
{
|
||||
fByteOffset = offset;
|
||||
}
|
||||
|
||||
inline void DOMLocatorImpl::setUtf16Offset(const XMLFilePos offset)
|
||||
{
|
||||
fUtf16Offset = offset;
|
||||
}
|
||||
|
||||
inline void DOMLocatorImpl::setRelatedNode(DOMNode* const errorNode)
|
||||
{
|
||||
fRelatedNode = errorNode;
|
||||
}
|
||||
|
||||
inline void DOMLocatorImpl::setURI(const XMLCh* const uri)
|
||||
{
|
||||
fURI = uri;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNamedNodeMapImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNamedNodeMap.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNodeVector;
|
||||
class DOMNode;
|
||||
|
||||
#define MAP_SIZE 193
|
||||
|
||||
class CDOM_EXPORT DOMNamedNodeMapImpl: public DOMNamedNodeMap {
|
||||
protected:
|
||||
DOMNodeVector* fBuckets[MAP_SIZE];
|
||||
DOMNode* fOwnerNode; // the node this map belongs to
|
||||
//bool fReadOnly; // revisit - flag on owner node instead?
|
||||
|
||||
bool readOnly(); // revisit. Look at owner node read-only.
|
||||
|
||||
public:
|
||||
DOMNamedNodeMapImpl(DOMNode *ownerNode);
|
||||
|
||||
virtual ~DOMNamedNodeMapImpl();
|
||||
virtual DOMNamedNodeMapImpl *cloneMap(DOMNode *ownerNode);
|
||||
virtual void setReadOnly(bool readOnly, bool deep);
|
||||
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual DOMNode* item(XMLSize_t index) const;
|
||||
virtual DOMNode* getNamedItem(const XMLCh *name) const;
|
||||
virtual DOMNode* setNamedItem(DOMNode *arg);
|
||||
virtual DOMNode* removeNamedItem(const XMLCh *name);
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName) const;
|
||||
virtual DOMNode* setNamedItemNS(DOMNode *arg);
|
||||
virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI,
|
||||
const XMLCh *localName);
|
||||
private:
|
||||
// unimplemented
|
||||
DOMNamedNodeMapImpl(const DOMNamedNodeMapImpl &);
|
||||
DOMNamedNodeMapImpl & operator = (const DOMNamedNodeMapImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeIDMap.hpp 676911 2008-07-15 13:27:32Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
//
|
||||
// Class DOMNodeIDMap is a hash table that is used in the implementation of
|
||||
// of DOM_Document::getElementsByID().
|
||||
//
|
||||
// Why Yet Another HashTable implementation? Becuase it can be significantly
|
||||
// smaller when tuned for this exact usage, and the generic RefHashTableOf
|
||||
// from the xerces utils project is not a paricularly good fit.
|
||||
//
|
||||
class DOMAttr;
|
||||
class DOMDocument;
|
||||
|
||||
|
||||
class DOMNodeIDMap {
|
||||
public:
|
||||
|
||||
DOMNodeIDMap(XMLSize_t initialSize, DOMDocument *doc); // Create a new hash table, sized to hold "initialSize"
|
||||
// Entries. It will automatically grow if need be.
|
||||
|
||||
~DOMNodeIDMap();
|
||||
|
||||
private:
|
||||
DOMNodeIDMap(const DOMNodeIDMap &other); // No copy, assignement, comparison.
|
||||
DOMNodeIDMap &operator = (const DOMNodeIDMap &other);
|
||||
bool operator == (const DOMNodeIDMap &other);
|
||||
|
||||
public:
|
||||
void add(DOMAttr *attr); // Add the specified attribute to the table.
|
||||
void remove(DOMAttr *other); // Remove the specified attribute.
|
||||
// Does nothing if the node is not in the table.
|
||||
DOMAttr *find(const XMLCh *ID); // Find the attribute node in the table with this ID
|
||||
|
||||
private:
|
||||
void growTable();
|
||||
|
||||
private:
|
||||
DOMAttr **fTable;
|
||||
XMLSize_t fSizeIndex; // Index of the current table size in the
|
||||
// array of possible table sizes.
|
||||
XMLSize_t fSize; // The current size of the table array
|
||||
// (number of slots, not bytes.)
|
||||
XMLSize_t fNumEntries; // The number of entries used.
|
||||
XMLSize_t fMaxEntries; // The max number of entries to use before
|
||||
// growing the table.
|
||||
DOMDocument *fDoc; // The owning document.
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,382 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
/**
|
||||
* A DOMNodeImpl doesn't have any children, and can therefore only be directly
|
||||
* inherited by classes of nodes that never have any, such as Text nodes. For
|
||||
* other types, such as Element, classes must inherit from ParentNode.
|
||||
* <P>
|
||||
* All nodes in a single document must originate
|
||||
* in that document. (Note that this is much tighter than "must be
|
||||
* same implementation") Nodes are all aware of their ownerDocument,
|
||||
* and attempts to mismatch will throw WRONG_DOCUMENT_ERR.
|
||||
* <P>
|
||||
* However, to save memory not all nodes always have a direct reference
|
||||
* to their ownerDocument. When a node is owned by another node it relies
|
||||
* on its owner to store its ownerDocument. Parent nodes always store it
|
||||
* though, so there is never more than one level of indirection.
|
||||
* And when a node doesn't have an owner, ownerNode refers to its
|
||||
* ownerDocument.
|
||||
**/
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMUserDataHandler.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNamedNodeMap;
|
||||
class DOMNodeList;
|
||||
class DOMNode;
|
||||
class DOMDocument;
|
||||
class DOMElement;
|
||||
|
||||
class CDOM_EXPORT DOMNodeImpl {
|
||||
public:
|
||||
|
||||
// data
|
||||
DOMNode *fOwnerNode; // typically the parent but not always!
|
||||
|
||||
unsigned short flags;
|
||||
|
||||
static const unsigned short READONLY;
|
||||
static const unsigned short SYNCDATA;
|
||||
static const unsigned short SYNCCHILDREN;
|
||||
static const unsigned short OWNED;
|
||||
static const unsigned short FIRSTCHILD;
|
||||
static const unsigned short SPECIFIED;
|
||||
static const unsigned short IGNORABLEWS;
|
||||
static const unsigned short SETVALUE;
|
||||
static const unsigned short ID_ATTR;
|
||||
static const unsigned short USERDATA;
|
||||
static const unsigned short LEAFNODETYPE;
|
||||
static const unsigned short CHILDNODE;
|
||||
static const unsigned short TOBERELEASED;
|
||||
|
||||
|
||||
public:
|
||||
DOMNodeImpl(DOMNode *ownerDocument);
|
||||
DOMNodeImpl(const DOMNodeImpl &other);
|
||||
~DOMNodeImpl();
|
||||
|
||||
DOMNode * appendChild(DOMNode *newChild);
|
||||
DOMNamedNodeMap * getAttributes() const;
|
||||
DOMNodeList * getChildNodes() const;
|
||||
DOMNode * getFirstChild() const;
|
||||
DOMNode * getLastChild() const;
|
||||
const XMLCh * getLocalName() const;
|
||||
const XMLCh * getNamespaceURI() const;
|
||||
DOMNode * getNextSibling() const;
|
||||
const XMLCh * getNodeValue() const;
|
||||
DOMDocument * getOwnerDocument() const;
|
||||
DOMNode * getParentNode() const;
|
||||
const XMLCh * getPrefix() const;
|
||||
DOMNode * getPreviousSibling() const;
|
||||
bool hasChildNodes() const;
|
||||
DOMNode * insertBefore(DOMNode *newChild, DOMNode *refChild);
|
||||
void normalize();
|
||||
DOMNode * removeChild(DOMNode *oldChild);
|
||||
DOMNode * replaceChild(DOMNode *newChild, DOMNode *oldChild);
|
||||
void setNodeValue(const XMLCh *value);
|
||||
void setPrefix(const XMLCh *fPrefix);
|
||||
void setReadOnly(bool readOnly, bool deep);
|
||||
bool isSupported(const XMLCh *feature, const XMLCh *version) const;
|
||||
bool hasAttributes() const;
|
||||
|
||||
// Introduced in DOM Level 3
|
||||
void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler);
|
||||
void* getUserData(const XMLCh* key) const;
|
||||
bool isSameNode(const DOMNode* other) const;
|
||||
bool isEqualNode(const DOMNode* arg) const;
|
||||
const XMLCh* getBaseURI() const ;
|
||||
short compareDocumentPosition(const DOMNode* other) const;
|
||||
const XMLCh* getTextContent() const ;
|
||||
const XMLCh* getTextContent(XMLCh* pzBuffer, XMLSize_t& rnBufferLength) const;
|
||||
void setTextContent(const XMLCh* textContent) ;
|
||||
const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;
|
||||
bool isDefaultNamespace(const XMLCh* namespaceURI) const ;
|
||||
const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;
|
||||
void* getFeature(const XMLCh* feature, const XMLCh* version) const;
|
||||
|
||||
|
||||
// Helper functions for DOM Level 3
|
||||
void release();
|
||||
void callUserDataHandlers(DOMUserDataHandler::DOMOperationType operation,
|
||||
const DOMNode* src,
|
||||
DOMNode* dst) const;
|
||||
//reverses the bit pattern given by compareDocumentPosition
|
||||
short reverseTreeOrderBitPattern(short pattern) const;
|
||||
const DOMNode* getTreeParentNode(const DOMNode* node) const;
|
||||
|
||||
|
||||
//Utility, not part of DOM Level 2 API
|
||||
static bool isKidOK(DOMNode *parent, DOMNode *child);
|
||||
static const XMLCh *mapPrefix(const XMLCh *prefix,
|
||||
const XMLCh *namespaceURI, short nType);
|
||||
|
||||
static const XMLCh *getXmlnsString();
|
||||
static const XMLCh *getXmlnsURIString();
|
||||
static const XMLCh *getXmlString();
|
||||
static const XMLCh *getXmlURIString();
|
||||
|
||||
public: // should really be protected - ALH
|
||||
|
||||
DOMNode* getElementAncestor (const DOMNode* currentNode) const;
|
||||
const XMLCh* lookupPrefix(const XMLCh* const namespaceURI, DOMElement *el) const ;
|
||||
void setOwnerDocument(DOMDocument *doc);
|
||||
|
||||
/*
|
||||
* Flags setters and getters
|
||||
*/
|
||||
|
||||
inline bool isReadOnly() const {
|
||||
return (flags & READONLY) != 0;
|
||||
}
|
||||
|
||||
inline void isReadOnly(bool value) {
|
||||
flags = (value ? flags | READONLY : flags & ~READONLY);
|
||||
}
|
||||
|
||||
inline bool needsSyncData() const {
|
||||
return (flags & SYNCDATA) != 0;
|
||||
}
|
||||
|
||||
inline void needsSyncData(bool value) {
|
||||
flags = (value ? flags | SYNCDATA : flags & ~SYNCDATA);
|
||||
}
|
||||
|
||||
inline bool needsSyncChildren() const {
|
||||
return (flags & SYNCCHILDREN) != 0;
|
||||
}
|
||||
|
||||
inline void needsSyncChildren(bool value) {
|
||||
flags = (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
|
||||
}
|
||||
|
||||
// For Attributes, true if the attr node is attached to an element.
|
||||
// For all other node types, true if the node has a parent node.
|
||||
inline bool isOwned() const {
|
||||
return (flags & OWNED) != 0;
|
||||
}
|
||||
|
||||
inline void isOwned(bool value) {
|
||||
flags = (value ? flags | OWNED : flags & ~OWNED);
|
||||
}
|
||||
|
||||
inline bool isFirstChild() const {
|
||||
return (flags & FIRSTCHILD) != 0;
|
||||
}
|
||||
|
||||
inline void isFirstChild(bool value) {
|
||||
flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
|
||||
}
|
||||
|
||||
inline bool isSpecified() const {
|
||||
return (flags & SPECIFIED) != 0;
|
||||
}
|
||||
|
||||
inline void isSpecified(bool value) {
|
||||
flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED);
|
||||
}
|
||||
|
||||
inline bool ignorableWhitespace() const {
|
||||
return (flags & IGNORABLEWS) != 0;
|
||||
}
|
||||
|
||||
inline void ignorableWhitespace(bool value) {
|
||||
flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
|
||||
}
|
||||
|
||||
inline bool setValue() const {
|
||||
return (flags & SETVALUE) != 0;
|
||||
}
|
||||
|
||||
inline void setValue(bool value) {
|
||||
flags = (value ? flags | SETVALUE : flags & ~SETVALUE);
|
||||
}
|
||||
|
||||
inline bool isIdAttr() const {
|
||||
return (flags & ID_ATTR) != 0;
|
||||
}
|
||||
|
||||
inline void isIdAttr(bool value) {
|
||||
flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR);
|
||||
}
|
||||
|
||||
inline bool hasUserData() const {
|
||||
return (flags & USERDATA) != 0;
|
||||
}
|
||||
|
||||
inline void hasUserData(bool value) {
|
||||
flags = (value ? flags | USERDATA : flags & ~USERDATA);
|
||||
}
|
||||
|
||||
//
|
||||
// LeafNode is set true for node types that can not be ParentNodes (can't have children)
|
||||
// This knowledge is used to allow casting from any unknown node type to the
|
||||
// IDParentImpl or IDChildImpl parts of the node.
|
||||
//
|
||||
inline bool isLeafNode() const {
|
||||
return (flags & LEAFNODETYPE) != 0;
|
||||
}
|
||||
|
||||
inline void setIsLeafNode(bool value) {
|
||||
flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ChildNode is set true for node types that can be children of other nodes, and
|
||||
// therefore include a DOMChildNode data member. Note that all of the leaf
|
||||
// node types (above flag) are also ChildNodes, but not all ChildNodes are
|
||||
// leaf nodes.
|
||||
inline bool isChildNode() const {
|
||||
return (flags & CHILDNODE) != 0;
|
||||
}
|
||||
|
||||
inline void setIsChildNode(bool value) {
|
||||
flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);
|
||||
}
|
||||
|
||||
// True if this node has to be released regardless if it has a owner or not
|
||||
// This is true if called from fParent->release()
|
||||
inline bool isToBeReleased() const {
|
||||
return (flags & TOBERELEASED) != 0;
|
||||
}
|
||||
|
||||
inline void isToBeReleased(bool value) {
|
||||
flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// This macro lists all of the pure virtual functions declared in DOMNode that must
|
||||
// be implemented by all node types. Since there is no inheritance of implementation,
|
||||
// using this macro in the class declaration of the node types make it easier to
|
||||
// accurately get all of the functions declared.
|
||||
//
|
||||
#define DOMNODE_FUNCTIONS \
|
||||
virtual DOMNode* appendChild(DOMNode *newChild) ;\
|
||||
virtual DOMNode* cloneNode(bool deep) const ;\
|
||||
virtual DOMNamedNodeMap* getAttributes() const ;\
|
||||
virtual DOMNodeList* getChildNodes() const ;\
|
||||
virtual DOMNode* getFirstChild() const ;\
|
||||
virtual DOMNode* getLastChild() const ;\
|
||||
virtual const XMLCh* getLocalName() const ;\
|
||||
virtual const XMLCh* getNamespaceURI() const ;\
|
||||
virtual DOMNode* getNextSibling() const ;\
|
||||
virtual const XMLCh* getNodeName() const ;\
|
||||
virtual NodeType getNodeType() const ;\
|
||||
virtual const XMLCh* getNodeValue() const ;\
|
||||
virtual DOMDocument* getOwnerDocument() const ;\
|
||||
virtual const XMLCh* getPrefix() const ;\
|
||||
virtual DOMNode* getParentNode() const ;\
|
||||
virtual DOMNode* getPreviousSibling() const ;\
|
||||
virtual bool hasChildNodes() const ;\
|
||||
virtual DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild) ;\
|
||||
virtual void normalize() ;\
|
||||
virtual DOMNode* removeChild(DOMNode *oldChild) ;\
|
||||
virtual DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild) ;\
|
||||
virtual void setNodeValue(const XMLCh *nodeValue) ;\
|
||||
virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const ;\
|
||||
virtual bool hasAttributes() const ;\
|
||||
virtual void setPrefix(const XMLCh * prefix) ;\
|
||||
virtual void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\
|
||||
virtual void* getUserData(const XMLCh* key) const ;\
|
||||
virtual bool isSameNode(const DOMNode* other) const;\
|
||||
virtual bool isEqualNode(const DOMNode* arg) const;\
|
||||
virtual const XMLCh* getBaseURI() const ;\
|
||||
virtual short compareDocumentPosition(const DOMNode* other) const ;\
|
||||
virtual const XMLCh* getTextContent() const ;\
|
||||
const XMLCh* getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const;\
|
||||
virtual void setTextContent(const XMLCh* textContent) ;\
|
||||
virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;\
|
||||
virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const;\
|
||||
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;\
|
||||
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const ;\
|
||||
virtual void release()
|
||||
|
||||
|
||||
/*
|
||||
* Here are dummy stubs for most of the functions introduced by DOMNode.
|
||||
* Each subclass of DOMNode will have something like this that delegates each
|
||||
* function to the appropriate implementation.
|
||||
* Functions that must be supplied by every node class are omitted.
|
||||
*
|
||||
DOMNode* xxx::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); };
|
||||
DOMNamedNodeMap* xxx::getAttributes() const {return fNode.getAttributes (); };
|
||||
DOMNodeList* xxx::getChildNodes() const {return fParent.getChildNodes (); };
|
||||
DOMNode* xxx::getFirstChild() const {return fParent.getFirstChild (); };
|
||||
DOMNode* xxx::getLastChild() const {return fParent.getLastChild (); };
|
||||
const XMLCh* xxx::getLocalName() const {return fNode.getLocalName (); };
|
||||
const XMLCh* xxx::getNamespaceURI() const {return fNode.getNamespaceURI (); };
|
||||
DOMNode* xxx::getNextSibling() const {return fChild.getNextSibling (); };
|
||||
const XMLCh* xxx::getNodeValue() const {return fNode.getNodeValue (); };
|
||||
DOMDocument* xxx::getOwnerDocument() const {return fNode.getOwnerDocument (); };
|
||||
const XMLCh* xxx::getPrefix() const {return fNode.getPrefix (); };
|
||||
DOMNode* xxx::getParentNode() const {return fChild.getParentNode (this); };
|
||||
DOMNode* xxx::getPreviousSibling() const {return fChild.getPreviousSibling (this); };
|
||||
bool xxx::hasChildNodes() const {return fParent.hasChildNodes (); };
|
||||
DOMNode* xxx::insertBefore(DOMNode *newChild, DOMNode *refChild)
|
||||
{return fParent.insertBefore (newChild, refChild); };
|
||||
void xxx::normalize() {fParent.normalize(); };
|
||||
DOMNode* xxx::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); };
|
||||
DOMNode* xxx::replaceChild(DOMNode *newChild, DOMNode *oldChild)
|
||||
{return fParent.replaceChild (newChild, oldChild); };
|
||||
bool xxx::isSupported(const XMLCh *feature, const XMLCh *version) const
|
||||
{return fNode.isSupported (feature, version); };
|
||||
void xxx::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); };
|
||||
bool xxx::hasAttributes() const {return fNode.hasAttributes(); };
|
||||
bool xxx::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); };
|
||||
bool xxx::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); };
|
||||
void* xxx::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler)
|
||||
{return fNode.setUserData(key, data, handler); };
|
||||
void* xxx::getUserData(const XMLCh* key) const {return fNode.getUserData(key); };
|
||||
const XMLCh* xxx::getBaseURI() const {return fNode.getBaseURI(); };
|
||||
short xxx::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); };
|
||||
const XMLCh* xxx::getTextContent() const {return fNode.getTextContent(); };
|
||||
void xxx::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); };
|
||||
const XMLCh* xxx::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); };
|
||||
bool xxx::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); };
|
||||
const XMLCh* xxx::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); };
|
||||
void* xxx::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); };
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeIteratorImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// DOMNodeIteratorImpl.hpp: interface for the DOMNodeIteratorImpl class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <xercesc/dom/DOMNode.hpp>
|
||||
#include <xercesc/dom/DOMNodeIterator.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class CDOM_EXPORT DOMNodeIteratorImpl : public DOMNodeIterator {
|
||||
protected:
|
||||
//
|
||||
// Data
|
||||
//
|
||||
// The root.
|
||||
DOMNode* fRoot;
|
||||
|
||||
// The Document used to create this iterator
|
||||
DOMDocument* fDocument;
|
||||
|
||||
// The whatToShow mask.
|
||||
DOMNodeFilter::ShowType fWhatToShow;
|
||||
|
||||
// The NodeFilter reference.
|
||||
DOMNodeFilter* fNodeFilter;
|
||||
|
||||
|
||||
// The expandEntity reference flag.
|
||||
bool fExpandEntityReferences;
|
||||
bool fDetached;
|
||||
|
||||
|
||||
//
|
||||
// Iterator state - current node and direction.
|
||||
//
|
||||
// Note: The current node and direction are sufficient to implement
|
||||
// the desired behaviour of the current pointer being _between_
|
||||
// two nodes. The fCurrentNode is actually the last node returned,
|
||||
// and the
|
||||
// direction is whether the pointer is in front or behind this node.
|
||||
// (usually akin to whether the node was returned via nextNode())
|
||||
// (eg fForward = true) or previousNode() (eg fForward = false).
|
||||
// The last Node returned.
|
||||
DOMNode* fCurrentNode;
|
||||
|
||||
// The direction of the iterator on the fCurrentNode.
|
||||
// <code>
|
||||
// nextNode() == fForward = true;<br>
|
||||
// previousNode() == fForward = false;<br>
|
||||
// </code>
|
||||
bool fForward;
|
||||
|
||||
public:
|
||||
virtual ~DOMNodeIteratorImpl ();
|
||||
DOMNodeIteratorImpl (
|
||||
DOMDocument* fDocument,
|
||||
DOMNode* root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* nodeFilter,
|
||||
bool expandEntityRef);
|
||||
|
||||
DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy);
|
||||
DOMNodeIteratorImpl& operator= (const DOMNodeIteratorImpl& other);
|
||||
|
||||
virtual DOMNode* getRoot ();
|
||||
virtual DOMNodeFilter::ShowType getWhatToShow ();
|
||||
virtual DOMNodeFilter* getFilter ();
|
||||
// Get the expandEntity reference flag.
|
||||
virtual bool getExpandEntityReferences();
|
||||
|
||||
virtual DOMNode* nextNode ();
|
||||
virtual DOMNode* previousNode ();
|
||||
virtual void detach ();
|
||||
|
||||
virtual void release();
|
||||
void removeNode (DOMNode* node);
|
||||
|
||||
protected:
|
||||
DOMNode* matchNodeOrParent (DOMNode* node);
|
||||
DOMNode* nextNode (DOMNode* node, bool visitChildren);
|
||||
DOMNode* previousNode (DOMNode* node);
|
||||
bool acceptNode (DOMNode* node);
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeListImpl.hpp 676911 2008-07-15 13:27:32Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
// NodeList implementation class -
|
||||
// This is for NodeLists returned by GetChildNodes only, not for
|
||||
// node lists returned by GetElementsByTagName
|
||||
//
|
||||
// Every node type capable of having children has (as an embedded member)
|
||||
// an instance of this class. To hold down the size overhead on each node, a
|
||||
// cache of extended data for active node lists is maintained
|
||||
// separately.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNodeList.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMParentNode;
|
||||
class DOMNode;
|
||||
|
||||
class CDOM_EXPORT DOMNodeListImpl: public DOMNodeList
|
||||
{
|
||||
protected:
|
||||
DOMParentNode *fNode;
|
||||
|
||||
private:
|
||||
// Unused, and unimplemented constructors, operators, etc.
|
||||
DOMNodeListImpl();
|
||||
DOMNodeListImpl(const DOMNodeListImpl & other);
|
||||
DOMNodeListImpl & operator = (const DOMNodeListImpl & other);
|
||||
|
||||
public:
|
||||
DOMNodeListImpl(DOMParentNode *node);
|
||||
virtual ~DOMNodeListImpl();
|
||||
virtual DOMNode * item(XMLSize_t index) const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNodeVector.hpp 676796 2008-07-15 05:04:13Z dbertoni $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMNode;
|
||||
class DOMDocument;
|
||||
|
||||
|
||||
class DOMNodeVector {
|
||||
private:
|
||||
DOMNode **data;
|
||||
XMLSize_t allocatedSize;
|
||||
XMLSize_t nextFreeSlot;
|
||||
void init(DOMDocument *doc, XMLSize_t size);
|
||||
void checkSpace();
|
||||
|
||||
// unimplemented
|
||||
DOMNodeVector ( const DOMNodeVector& toCopy);
|
||||
DOMNodeVector& operator= (const DOMNodeVector& other);
|
||||
|
||||
public:
|
||||
DOMNodeVector(DOMDocument *doc);
|
||||
DOMNodeVector(DOMDocument *doc, XMLSize_t size);
|
||||
~DOMNodeVector();
|
||||
|
||||
XMLSize_t size();
|
||||
DOMNode* elementAt(XMLSize_t index);
|
||||
DOMNode* lastElement();
|
||||
void addElement(DOMNode *);
|
||||
void insertElementAt(DOMNode *, XMLSize_t index);
|
||||
void setElementAt(DOMNode *val, XMLSize_t index);
|
||||
void removeElementAt(XMLSize_t index);
|
||||
void reset();
|
||||
};
|
||||
|
||||
inline DOMNode *DOMNodeVector::elementAt(XMLSize_t index) {
|
||||
if (index >= nextFreeSlot)
|
||||
return 0;
|
||||
return data[index];
|
||||
}
|
||||
|
||||
inline DOMNode *DOMNodeVector::lastElement() {
|
||||
if (nextFreeSlot == 0)
|
||||
return 0;
|
||||
return data[nextFreeSlot-1];
|
||||
}
|
||||
|
||||
inline XMLSize_t DOMNodeVector::size() {
|
||||
return nextFreeSlot;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNormalizer.hpp 676911 2008-07-15 13:27:32Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/RefHashTableOf.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
#include <xercesc/framework/XMLErrorCodes.hpp>
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMConfigurationImpl;
|
||||
class DOMErrorHandler;
|
||||
class DOMDocumentImpl;
|
||||
class DOMNode;
|
||||
class DOMElementImpl;
|
||||
class DOMAttr;
|
||||
class DOMNamedNodeMap;
|
||||
|
||||
class DOMNormalizer : public XMemory {
|
||||
|
||||
//the following are the data structures maintain the stack of namespace information
|
||||
class InScopeNamespaces : public XMemory {
|
||||
class Scope : public XMemory {
|
||||
public:
|
||||
Scope(Scope *baseScopeWithBindings);
|
||||
~Scope();
|
||||
void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
const XMLCh* getUri(const XMLCh *prefix) const;
|
||||
const XMLCh* getPrefix(const XMLCh* uri) const;
|
||||
Scope *fBaseScopeWithBindings;
|
||||
|
||||
private:
|
||||
RefHashTableOf<XMLCh> *fPrefixHash;
|
||||
RefHashTableOf<XMLCh> *fUriHash;
|
||||
// unimplemented
|
||||
Scope ( const Scope& toCopy);
|
||||
Scope& operator= (const Scope& other);
|
||||
};
|
||||
|
||||
public:
|
||||
InScopeNamespaces(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~InScopeNamespaces();
|
||||
void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
void addScope(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
void removeScope();
|
||||
bool isValidBinding(const XMLCh* prefix, const XMLCh* uri) const;
|
||||
const XMLCh* getOrDeclarePrefix(const XMLCh* uri);
|
||||
const XMLCh* getPrefix(const XMLCh* uri) const;
|
||||
const XMLCh* getUri(const XMLCh* prefix) const;
|
||||
XMLSize_t size();
|
||||
|
||||
private:
|
||||
RefVectorOf<Scope> *fScopes;
|
||||
Scope *lastScopeWithBindings;
|
||||
// unimplemented
|
||||
InScopeNamespaces ( const InScopeNamespaces& toCopy);
|
||||
InScopeNamespaces& operator= (const InScopeNamespaces& other);
|
||||
};
|
||||
|
||||
public:
|
||||
DOMNormalizer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMNormalizer();
|
||||
|
||||
/**
|
||||
* Main entry method to normalize a document
|
||||
*/
|
||||
void normalizeDocument(DOMDocumentImpl *doc);
|
||||
|
||||
private:
|
||||
// unimplemented
|
||||
DOMNormalizer ( const DOMNormalizer& toCopy);
|
||||
DOMNormalizer& operator= (const DOMNormalizer& other);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Recursively normalizes a node
|
||||
*/
|
||||
DOMNode * normalizeNode(DOMNode *node) const;
|
||||
|
||||
/**
|
||||
* Helper method that fixes up the namespace declarations according to the
|
||||
* DOM Level 3 psydocode
|
||||
*/
|
||||
void namespaceFixUp(DOMElementImpl *ele) const;
|
||||
|
||||
/**
|
||||
* Converts an integer to an XMLCh - max 15 digits long.
|
||||
*/
|
||||
const XMLCh * integerToXMLCh(unsigned int i) const;
|
||||
|
||||
/**
|
||||
* Adds a namespace attribute or replaces the value of existing namespace
|
||||
* attribute with the given prefix and value for URI.
|
||||
* In case prefix is empty will add/update default namespace declaration.
|
||||
*/
|
||||
void addOrChangeNamespaceDecl(const XMLCh* prefix, const XMLCh* uri, DOMElementImpl *element) const;
|
||||
|
||||
/**
|
||||
* Adds a custom namespace in the form "NSx" where x is an integer that
|
||||
* has not yet used in the document
|
||||
*/
|
||||
const XMLCh* addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const;
|
||||
|
||||
|
||||
/**
|
||||
* Report an error
|
||||
*/
|
||||
void error(const XMLErrs::Codes code, const DOMNode *node) const;
|
||||
|
||||
//
|
||||
// fDocument - the document we are operating on
|
||||
//
|
||||
// fDOMConfiguration - the configuration from the document
|
||||
//
|
||||
// fErrorHandler - the errorhandler to be used when reporting errors during normalization
|
||||
//
|
||||
// fNSScope - the data stucture that holds the prefix-uri information
|
||||
//
|
||||
// fNewNamespaceCount - the number of custom namespace declarations we have created
|
||||
//
|
||||
DOMDocumentImpl *fDocument;
|
||||
DOMConfigurationImpl *fConfiguration;
|
||||
DOMErrorHandler *fErrorHandler;
|
||||
InScopeNamespaces *fNSScope;
|
||||
unsigned int fNewNamespaceCount;
|
||||
MemoryManager* fMemoryManager;
|
||||
};
|
||||
|
||||
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMNotationImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMNOTATIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMNOTATIONIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMNotation.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
#include "DOMNodeImpl.hpp"
|
||||
|
||||
class DOMDocument;
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMNotationImpl: public DOMNotation {
|
||||
public:
|
||||
DOMNodeImpl fNode;
|
||||
|
||||
const XMLCh * fName;
|
||||
const XMLCh * fPublicId;
|
||||
const XMLCh * fSystemId;
|
||||
const XMLCh * fBaseURI;
|
||||
|
||||
public:
|
||||
DOMNotationImpl(DOMDocument *ownerDoc, const XMLCh *);
|
||||
DOMNotationImpl(const DOMNotationImpl &other, bool deep=false);
|
||||
|
||||
virtual ~DOMNotationImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
//
|
||||
// The Public Identifier for this Notation. If no public identifier
|
||||
// was specified, this will be null.
|
||||
virtual const XMLCh * getPublicId() const;
|
||||
|
||||
// The System Identifier for this Notation. If no system identifier
|
||||
// was specified, this will be null.
|
||||
virtual const XMLCh * getSystemId() const;
|
||||
|
||||
// NON-DOM: The Public Identifier for this Notation. If no public
|
||||
// identifier was specified, this will be null.
|
||||
virtual void setPublicId(const XMLCh *arg);
|
||||
|
||||
|
||||
// NON-DOM: The System Identifier for this Notation. If no system
|
||||
// identifier was specified, this will be null.
|
||||
virtual void setSystemId(const XMLCh *arg);
|
||||
|
||||
// NON-DOM: set base uri
|
||||
virtual void setBaseURI(const XMLCh *arg);
|
||||
|
||||
private:
|
||||
// unimplemented
|
||||
DOMNotationImpl& operator= (const DOMNotationImpl& other);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMParentNode.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
/**
|
||||
* ParentNode provides the capability of having child
|
||||
* nodes. Not every node in the DOM can have children, so only nodes that can
|
||||
* should include this class and pay the price for it.
|
||||
* <P>
|
||||
* While we have a direct reference to the first child, the last child is
|
||||
* stored as the previous sibling of the first child. First child nodes are
|
||||
* marked as being so, and getNextSibling hides this fact.
|
||||
*
|
||||
**/
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include "DOMNodeListImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DOMChildNode;
|
||||
class DOMDocument;
|
||||
class DOMNode;
|
||||
class DOMNodeList;
|
||||
|
||||
class CDOM_EXPORT DOMParentNode {
|
||||
public:
|
||||
DOMDocument *fOwnerDocument; // Document this node belongs to
|
||||
DOMNode *fFirstChild;
|
||||
DOMNodeListImpl fChildNodeList; // for GetChildNodes()
|
||||
|
||||
public:
|
||||
DOMParentNode(DOMDocument *ownerDocument);
|
||||
DOMParentNode(const DOMParentNode &other);
|
||||
|
||||
DOMDocument * getOwnerDocument() const;
|
||||
void setOwnerDocument(DOMDocument* doc);
|
||||
|
||||
// Track changes to the node tree structure under this node. An optimization
|
||||
// for NodeLists.
|
||||
int changes() const;
|
||||
void changed();
|
||||
|
||||
DOMNode* appendChild(DOMNode *newChild);
|
||||
DOMNodeList* getChildNodes() const;
|
||||
DOMNode* getFirstChild() const;
|
||||
DOMNode* getLastChild() const;
|
||||
bool hasChildNodes() const;
|
||||
DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild);
|
||||
DOMNode* item(unsigned int index) const;
|
||||
DOMNode* removeChild(DOMNode *oldChild);
|
||||
DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild);
|
||||
|
||||
// Append certain types of nodes fast. Used to speed up XML to DOM
|
||||
// parsing. See the function implementation for detail.
|
||||
virtual DOMNode* appendChildFast(DOMNode *newChild);
|
||||
|
||||
//Introduced in DOM Level 2
|
||||
void normalize();
|
||||
|
||||
//Introduced in DOM Level 3
|
||||
bool isEqualNode(const DOMNode* arg) const;
|
||||
|
||||
// NON-DOM
|
||||
// unlike getOwnerDocument this never returns null, even for Document nodes
|
||||
DOMDocument * getDocument() const;
|
||||
void release();
|
||||
|
||||
|
||||
public:
|
||||
void cloneChildren(const DOMNode *other);
|
||||
DOMNode * lastChild() const;
|
||||
void lastChild(DOMNode *);
|
||||
|
||||
private:
|
||||
// unimplemented
|
||||
DOMParentNode& operator= (const DOMParentNode& other);
|
||||
};
|
||||
|
||||
#define GetDOMParentNodeMemoryManager GET_DIRECT_MM(fOwnerDocument)
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMProcessingInstructionImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMProcessingInstruction.hpp>
|
||||
#include "DOMCharacterDataImpl.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMChildNode.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class DocumentImpl;
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMProcessingInstructionImpl: public DOMProcessingInstruction {
|
||||
protected:
|
||||
DOMNodeImpl fNode;
|
||||
DOMChildNode fChild;
|
||||
// use fCharacterData to store its data so that those character utitlites can be used
|
||||
DOMCharacterDataImpl fCharacterData;
|
||||
|
||||
XMLCh *fTarget;
|
||||
const XMLCh *fBaseURI;
|
||||
|
||||
public:
|
||||
DOMProcessingInstructionImpl(DOMDocument *ownerDoc,
|
||||
const XMLCh * target,
|
||||
const XMLCh *data);
|
||||
DOMProcessingInstructionImpl(const DOMProcessingInstructionImpl &other,
|
||||
bool deep=false);
|
||||
virtual ~DOMProcessingInstructionImpl();
|
||||
|
||||
public:
|
||||
// Declare all of the functions from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
virtual const XMLCh *getData() const;
|
||||
virtual const XMLCh *getTarget() const;
|
||||
virtual void setData(const XMLCh *arg);
|
||||
|
||||
// NON-DOM: set base uri
|
||||
virtual void setBaseURI(const XMLCh* baseURI);
|
||||
|
||||
// Non standard extension for the range to work
|
||||
void deleteData(XMLSize_t offset, XMLSize_t count);
|
||||
const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const;
|
||||
DOMProcessingInstruction* splitText(XMLSize_t offset);
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMProcessingInstructionImpl & operator = (const DOMProcessingInstructionImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMRangeImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMRange.hpp>
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
|
||||
class DOMNode;
|
||||
class DOMDocumentFragment;
|
||||
class DOMDocument;
|
||||
class DOMText;
|
||||
class MemoryManager;
|
||||
|
||||
class CDOM_EXPORT DOMRangeImpl: public DOMRange {
|
||||
protected:
|
||||
enum TraversalType {
|
||||
EXTRACT_CONTENTS = 1,
|
||||
CLONE_CONTENTS = 2,
|
||||
DELETE_CONTENTS = 3
|
||||
};
|
||||
|
||||
enum TraversePoint {
|
||||
BEFORE = -1,
|
||||
START = 0,
|
||||
AFTER = 1
|
||||
};
|
||||
|
||||
//private data
|
||||
|
||||
DOMNode* fStartContainer;
|
||||
XMLSize_t fStartOffset;
|
||||
DOMNode* fEndContainer;
|
||||
XMLSize_t fEndOffset;
|
||||
bool fCollapsed;
|
||||
DOMDocument* fDocument;
|
||||
bool fDetached;
|
||||
|
||||
DOMNode* fRemoveChild;
|
||||
MemoryManager* fMemoryManager;
|
||||
|
||||
public:
|
||||
//c'tor
|
||||
DOMRangeImpl(DOMDocument* doc, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
DOMRangeImpl(const DOMRangeImpl& other);
|
||||
|
||||
//d'tor
|
||||
~DOMRangeImpl();
|
||||
|
||||
//getter functions
|
||||
virtual DOMNode* getStartContainer() const;
|
||||
virtual XMLSize_t getStartOffset() const;
|
||||
virtual DOMNode* getEndContainer() const;
|
||||
virtual XMLSize_t getEndOffset() const;
|
||||
virtual bool getCollapsed() const;
|
||||
virtual const DOMNode* getCommonAncestorContainer() const;
|
||||
|
||||
//setter functions
|
||||
virtual void setStart(const DOMNode *parent, XMLSize_t offset);
|
||||
virtual void setEnd(const DOMNode *parent, XMLSize_t offset);
|
||||
|
||||
virtual void setStartBefore(const DOMNode *refNode);
|
||||
virtual void setStartAfter(const DOMNode *refNode);
|
||||
virtual void setEndBefore(const DOMNode *refNode);
|
||||
virtual void setEndAfter(const DOMNode *refNode);
|
||||
|
||||
//misc functions
|
||||
virtual void collapse(bool toStart);
|
||||
virtual void selectNode(const DOMNode *node);
|
||||
virtual void selectNodeContents(const DOMNode *node);
|
||||
|
||||
//Functions related to comparing range Boundrary-Points
|
||||
virtual short compareBoundaryPoints(CompareHow how, const DOMRange* range) const;
|
||||
virtual void deleteContents();
|
||||
virtual DOMDocumentFragment* extractContents();
|
||||
virtual DOMDocumentFragment* cloneContents() const;
|
||||
virtual void insertNode(DOMNode* node);
|
||||
|
||||
//Misc functions
|
||||
virtual void surroundContents(DOMNode *node);
|
||||
virtual DOMRange* cloneRange() const;
|
||||
virtual const XMLCh* toString() const;
|
||||
virtual void detach();
|
||||
virtual void release();
|
||||
|
||||
//getter functions
|
||||
DOMDocument* getDocument();
|
||||
|
||||
// functions to inform all existing valid ranges about a change
|
||||
void updateSplitInfo(DOMNode* oldNode, DOMNode* startNode, XMLSize_t offset);
|
||||
void updateRangeForInsertedNode(DOMNode* node);
|
||||
void receiveReplacedText(DOMNode* node);
|
||||
void updateRangeForDeletedText(DOMNode* node, XMLSize_t offset, XMLSize_t count);
|
||||
void updateRangeForInsertedText(DOMNode* node, XMLSize_t offset, XMLSize_t count);
|
||||
void updateRangeForDeletedNode(DOMNode* node);
|
||||
|
||||
protected:
|
||||
//setter functions
|
||||
void setStartContainer(const DOMNode* node);
|
||||
void setStartOffset(XMLSize_t offset) ;
|
||||
void setEndContainer(const DOMNode* node);
|
||||
void setEndOffset(XMLSize_t offset) ;
|
||||
|
||||
//misc functions
|
||||
void validateNode(const DOMNode* node) const;
|
||||
bool isValidAncestorType(const DOMNode* node) const;
|
||||
bool hasLegalRootContainer(const DOMNode* node) const;
|
||||
bool isLegalContainedNode(const DOMNode* node ) const;
|
||||
void checkIndex(const DOMNode* node, XMLSize_t offset) const;
|
||||
static bool isAncestorOf(const DOMNode* a, const DOMNode* b);
|
||||
|
||||
XMLSize_t indexOf(const DOMNode* child, const DOMNode* parent) const;
|
||||
|
||||
const DOMNode* commonAncestorOf(const DOMNode* pointA, const DOMNode* pointB) const;
|
||||
DOMNode* nextNode(const DOMNode* node, bool visitChildren) const;
|
||||
DOMDocumentFragment* traverseContents(TraversalType type);
|
||||
void checkReadOnly(DOMNode* start, DOMNode* end,
|
||||
XMLSize_t starOffset, XMLSize_t endOffset);
|
||||
void recurseTreeAndCheck(DOMNode* start, DOMNode* end);
|
||||
DOMNode* removeChild(DOMNode* parent, DOMNode* child);
|
||||
|
||||
DOMDocumentFragment* traverseSameContainer( int how );
|
||||
DOMDocumentFragment* traverseCommonStartContainer( DOMNode *endAncestor, int how );
|
||||
DOMDocumentFragment* traverseCommonEndContainer( DOMNode *startAncestor, int how );
|
||||
DOMDocumentFragment* traverseCommonAncestors( DOMNode *startAncestor, DOMNode *endAncestor, int how );
|
||||
DOMNode* traverseRightBoundary( DOMNode *root, int how );
|
||||
DOMNode* traverseLeftBoundary( DOMNode *root, int how );
|
||||
DOMNode* traverseNode( DOMNode *n, bool isFullySelected, bool isLeft, int how );
|
||||
DOMNode* traverseFullySelected( DOMNode *n, int how );
|
||||
DOMNode* traversePartiallySelected( DOMNode *n, int how );
|
||||
DOMNode* traverseTextNode( DOMNode *n, bool isLeft, int how );
|
||||
DOMNode* getSelectedNode( DOMNode *container, int offset );
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMRangeImpl & operator = (const DOMRangeImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMStringListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
#include <xercesc/dom/DOMStringList.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMStringListImpl: public XMemory,
|
||||
public DOMStringList
|
||||
{
|
||||
protected:
|
||||
RefVectorOf<XMLCh> *fList;
|
||||
|
||||
private:
|
||||
// Unused, and unimplemented constructors, operators, etc.
|
||||
DOMStringListImpl(const DOMStringListImpl & other);
|
||||
DOMStringListImpl & operator = (const DOMStringListImpl & other);
|
||||
|
||||
public:
|
||||
DOMStringListImpl(int nInitialSize, MemoryManager* manager);
|
||||
void add(const XMLCh* impl);
|
||||
|
||||
virtual ~DOMStringListImpl();
|
||||
virtual const XMLCh* item(XMLSize_t index) const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual bool contains(const XMLCh* str) const;
|
||||
virtual void release();
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,211 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMStringPool.hpp 678766 2008-07-22 14:00:16Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMDocumentImpl;
|
||||
|
||||
//
|
||||
// DStringPoolEntry - one of these structs is allocated for each
|
||||
// XMLCh String in the pool. Each slot in the
|
||||
// hash table array itself is a pointer to the head
|
||||
// of a singly-linked list of these structs.
|
||||
//
|
||||
// Although this struct is delcared with a string length of one,
|
||||
// the factory method allocates enough storage to hold the full
|
||||
// string length.
|
||||
//
|
||||
struct DOMStringPoolEntry
|
||||
{
|
||||
DOMStringPoolEntry *fNext;
|
||||
XMLCh fString[1];
|
||||
};
|
||||
|
||||
//
|
||||
// DOMBuffer is a lightweight text buffer
|
||||
// The buffer is not nul terminated until some asks to see the raw buffer
|
||||
// contents. This also avoids overhead during append operations.
|
||||
class DOMBuffer
|
||||
{
|
||||
public :
|
||||
// -----------------------------------------------------------------------
|
||||
// Constructors and Destructor
|
||||
// -----------------------------------------------------------------------
|
||||
DOMBuffer(DOMDocumentImpl *doc, XMLSize_t capacity = 31);
|
||||
|
||||
~DOMBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Buffer Management
|
||||
// -----------------------------------------------------------------------
|
||||
void append (const XMLCh* const chars);
|
||||
void append (const XMLCh* const chars, const XMLSize_t count);
|
||||
|
||||
void set (const XMLCh* const chars);
|
||||
void set (const XMLCh* const chars, const XMLSize_t count);
|
||||
|
||||
const XMLCh* getRawBuffer() const
|
||||
{
|
||||
fBuffer[fIndex] = 0;
|
||||
return fBuffer;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
fIndex = 0;
|
||||
fBuffer[0] = 0;
|
||||
}
|
||||
|
||||
void chop
|
||||
(
|
||||
const XMLSize_t count
|
||||
)
|
||||
{
|
||||
fBuffer[count] = 0;
|
||||
fIndex = count;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getters
|
||||
// -----------------------------------------------------------------------
|
||||
XMLSize_t getLen() const
|
||||
{
|
||||
return fIndex;
|
||||
}
|
||||
|
||||
XMLSize_t getCapacity() const
|
||||
{
|
||||
return fCapacity;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Private helpers
|
||||
// -----------------------------------------------------------------------
|
||||
void expandCapacity(const XMLSize_t extraNeeded);
|
||||
|
||||
|
||||
private :
|
||||
// -----------------------------------------------------------------------
|
||||
// Private data members
|
||||
//
|
||||
// fBuffer
|
||||
// The pointer to the buffer data. Its grown as needed. Its always
|
||||
// one larger than fCapacity, to leave room for the null terminator.
|
||||
//
|
||||
// fIndex
|
||||
// The current index into the buffer, as characters are appended
|
||||
// to it. If its zero, then the buffer is empty.
|
||||
//
|
||||
// fCapacity
|
||||
// The current capacity of the buffer. Its actually always one
|
||||
// larger, to leave room for the null terminator.
|
||||
//
|
||||
// fDoc
|
||||
// For allocating memory
|
||||
// -----------------------------------------------------------------------
|
||||
XMLCh* fBuffer;
|
||||
XMLSize_t fIndex;
|
||||
XMLSize_t fCapacity;
|
||||
DOMDocumentImpl* fDoc;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMBuffer(const DOMBuffer &);
|
||||
DOMBuffer & operator = (const DOMBuffer &);
|
||||
};
|
||||
|
||||
inline void DOMBuffer::
|
||||
append (const XMLCh* const chars)
|
||||
{
|
||||
XMLSize_t count = XMLString::stringLen(chars);
|
||||
if (fIndex + count >= fCapacity)
|
||||
expandCapacity(count);
|
||||
|
||||
memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh));
|
||||
fIndex += count;
|
||||
|
||||
// Keep it null terminated
|
||||
fBuffer[fIndex] = 0;
|
||||
}
|
||||
|
||||
inline void DOMBuffer::
|
||||
append (const XMLCh* const chars, const XMLSize_t count)
|
||||
{
|
||||
if (fIndex + count >= fCapacity)
|
||||
expandCapacity(count);
|
||||
|
||||
memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh));
|
||||
fIndex += count;
|
||||
|
||||
// Keep it null terminated
|
||||
fBuffer[fIndex] = 0;
|
||||
}
|
||||
|
||||
inline void DOMBuffer::
|
||||
set (const XMLCh* const chars)
|
||||
{
|
||||
XMLSize_t count = XMLString::stringLen(chars);
|
||||
fIndex = 0;
|
||||
if (count >= fCapacity)
|
||||
expandCapacity(count);
|
||||
|
||||
memcpy(fBuffer, chars, count * sizeof(XMLCh));
|
||||
fIndex = count;
|
||||
|
||||
// Keep it null terminated
|
||||
fBuffer[fIndex] = 0;
|
||||
}
|
||||
|
||||
inline void DOMBuffer::
|
||||
set (const XMLCh* const chars, const XMLSize_t count)
|
||||
{
|
||||
fIndex = 0;
|
||||
if (count >= fCapacity)
|
||||
expandCapacity(count);
|
||||
|
||||
memcpy(fBuffer, chars, count * sizeof(XMLCh));
|
||||
fIndex = count;
|
||||
|
||||
// Keep it null terminated
|
||||
fBuffer[fIndex] = 0;
|
||||
}
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMTextImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/dom/DOMText.hpp>
|
||||
|
||||
#include "DOMChildNode.hpp"
|
||||
#include "DOMNodeImpl.hpp"
|
||||
#include "DOMCharacterDataImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMTextImpl: public DOMText {
|
||||
public:
|
||||
DOMNodeImpl fNode;
|
||||
DOMChildNode fChild;
|
||||
DOMCharacterDataImpl fCharacterData;
|
||||
|
||||
public:
|
||||
DOMTextImpl(DOMDocument* ownerDoc, const XMLCh* data);
|
||||
DOMTextImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n);
|
||||
DOMTextImpl(const DOMTextImpl& other, bool deep=false);
|
||||
|
||||
virtual ~DOMTextImpl();
|
||||
virtual DOMText* splitText(XMLSize_t offset);
|
||||
// DOM Level 3
|
||||
virtual bool getIsElementContentWhitespace() const;
|
||||
virtual const XMLCh* getWholeText() const;
|
||||
virtual DOMText* replaceWholeText(const XMLCh* content);
|
||||
|
||||
// non-standard extension
|
||||
virtual bool isIgnorableWhitespace() const;
|
||||
|
||||
public:
|
||||
// Declare the functions coming from DOMNode.
|
||||
DOMNODE_FUNCTIONS;
|
||||
|
||||
public:
|
||||
// All of the functions coming from DOMCharacterData
|
||||
virtual const XMLCh* getData() const;
|
||||
virtual XMLSize_t getLength() const;
|
||||
virtual const XMLCh* substringData(XMLSize_t offset,
|
||||
XMLSize_t count) const;
|
||||
virtual void appendData(const XMLCh *arg);
|
||||
virtual void insertData(XMLSize_t offset, const XMLCh *arg);
|
||||
virtual void deleteData(XMLSize_t offset,
|
||||
XMLSize_t count);
|
||||
virtual void replaceData(XMLSize_t offset,
|
||||
XMLSize_t count,
|
||||
const XMLCh *arg);
|
||||
virtual void setData(const XMLCh *data);
|
||||
|
||||
// Non-standard extension.
|
||||
//
|
||||
virtual void appendData(const XMLCh *arg, XMLSize_t n);
|
||||
|
||||
protected:
|
||||
virtual void setIgnorableWhitespace(bool ignorable);
|
||||
friend class AbstractDOMParser;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMTextImpl & operator = (const DOMTextImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMTreeWalkerImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
#include <xercesc/dom/DOMTreeWalker.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
class CDOM_EXPORT DOMTreeWalkerImpl : public DOMTreeWalker {
|
||||
protected:
|
||||
// The whatToShow mask.
|
||||
DOMNodeFilter::ShowType fWhatToShow;
|
||||
|
||||
// The NodeFilter reference.
|
||||
DOMNodeFilter* fNodeFilter;
|
||||
|
||||
// The current Node.
|
||||
DOMNode* fCurrentNode;
|
||||
|
||||
// The root Node.
|
||||
DOMNode* fRoot;
|
||||
|
||||
// The expandEntity reference flag.
|
||||
bool fExpandEntityReferences;
|
||||
|
||||
public:
|
||||
// Implementation Note: No state is kept except the data above
|
||||
// (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that
|
||||
// setters could be created for these data values and the
|
||||
// implementation will still work.
|
||||
|
||||
/** Public constructor */
|
||||
DOMTreeWalkerImpl (
|
||||
DOMNode* root,
|
||||
DOMNodeFilter::ShowType whatToShow,
|
||||
DOMNodeFilter* nodeFilter,
|
||||
bool expandEntityRef);
|
||||
DOMTreeWalkerImpl (const DOMTreeWalkerImpl& twi);
|
||||
DOMTreeWalkerImpl& operator= (const DOMTreeWalkerImpl& twi);
|
||||
|
||||
// Return the root node.
|
||||
virtual DOMNode* getRoot ();
|
||||
|
||||
// Return the whatToShow value.
|
||||
virtual DOMNodeFilter::ShowType getWhatToShow ();
|
||||
|
||||
// Return the NodeFilter.
|
||||
virtual DOMNodeFilter* getFilter ();
|
||||
|
||||
|
||||
// Return the current DOMNode.
|
||||
virtual DOMNode* getCurrentNode ();
|
||||
|
||||
// Return the current Node.
|
||||
virtual void setCurrentNode (DOMNode* node);
|
||||
|
||||
// Return the parent Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* parentNode ();
|
||||
|
||||
// Return the first child Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* firstChild ();
|
||||
|
||||
// Return the last child Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* lastChild ();
|
||||
|
||||
// Return the previous sibling Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* previousSibling ();
|
||||
|
||||
// Return the next sibling Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
|
||||
virtual DOMNode* nextSibling ();
|
||||
// Return the previous Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* previousNode ();
|
||||
|
||||
// Return the next Node from the current node,
|
||||
// after applying filter, whatToshow.
|
||||
// If result is not null, set the current Node.
|
||||
virtual DOMNode* nextNode ();
|
||||
|
||||
// Get the expandEntity reference flag.
|
||||
virtual bool getExpandEntityReferences();
|
||||
|
||||
// release the resource
|
||||
virtual void release();
|
||||
|
||||
protected:
|
||||
|
||||
// Internal function.
|
||||
// Return the parent Node, from the input node
|
||||
// after applying filter, whatToshow.
|
||||
// The current node is not consulted or set.
|
||||
DOMNode* getParentNode (DOMNode* node);
|
||||
|
||||
// Internal function.
|
||||
// Return the nextSibling Node, from the input node
|
||||
// after applying filter, whatToshow.
|
||||
// The current node is not consulted or set.
|
||||
DOMNode* getNextSibling (DOMNode* node);
|
||||
|
||||
// Internal function.
|
||||
// Return the previous sibling Node, from the input node
|
||||
// after applying filter, whatToshow.
|
||||
// The current node is not consulted or set.
|
||||
DOMNode* getPreviousSibling (DOMNode* node);
|
||||
|
||||
// Internal function.
|
||||
// Return the first child Node, from the input node
|
||||
// after applying filter, whatToshow.
|
||||
// The current node is not consulted or set.
|
||||
DOMNode* getFirstChild (DOMNode* node);
|
||||
|
||||
// Internal function.
|
||||
// Return the last child Node, from the input node
|
||||
// after applying filter, whatToshow.
|
||||
// The current node is not consulted or set.
|
||||
DOMNode* getLastChild (DOMNode* node);
|
||||
|
||||
// The node is accepted if it passes the whatToShow and the filter.
|
||||
short acceptNode (DOMNode* node);
|
||||
|
||||
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------------------------------------------
|
||||
#include <xercesc/dom/DOMTypeInfo.hpp>
|
||||
#include <xercesc/dom/DOMPSVITypeInfo.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMDocumentImpl;
|
||||
|
||||
class CDOM_EXPORT DOMTypeInfoImpl : public DOMTypeInfo, public DOMPSVITypeInfo
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------------
|
||||
DOMTypeInfoImpl(const XMLCh* namespaceUri=0, const XMLCh* name=0);
|
||||
DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI);
|
||||
|
||||
static DOMTypeInfoImpl g_DtdValidatedElement;
|
||||
static DOMTypeInfoImpl g_DtdNotValidatedAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedCDATAAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedIDAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedIDREFAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedIDREFSAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedENTITYAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedENTITIESAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedNMTOKENAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedNMTOKENSAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedNOTATIONAttribute;
|
||||
static DOMTypeInfoImpl g_DtdValidatedENUMERATIONAttribute;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DOMTypeInfo interface
|
||||
// -----------------------------------------------------------------------
|
||||
virtual const XMLCh* getTypeName() const;
|
||||
virtual const XMLCh* getTypeNamespace() const;
|
||||
virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods derivationMethod) const;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DOMPSVITypeInfo interface
|
||||
// -----------------------------------------------------------------------
|
||||
virtual const XMLCh* getStringProperty(PSVIProperty prop) const;
|
||||
virtual int getNumericProperty(PSVIProperty prop) const;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Setter methods
|
||||
// -----------------------------------------------------------------------
|
||||
virtual void setStringProperty(PSVIProperty prop, const XMLCh* value);
|
||||
virtual void setNumericProperty(PSVIProperty prop, int value);
|
||||
|
||||
protected:
|
||||
int fBitFields;
|
||||
const XMLCh* fTypeName;
|
||||
const XMLCh* fTypeNamespace;
|
||||
const XMLCh* fMemberTypeName;
|
||||
const XMLCh* fMemberTypeNamespace;
|
||||
const XMLCh* fDefaultValue;
|
||||
const XMLCh* fNormalizedValue;
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
DOMTypeInfoImpl (const DOMTypeInfoImpl&);
|
||||
DOMTypeInfoImpl & operator = (const DOMTypeInfoImpl &);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* End of file DOMTypeInfo.hpp
|
||||
*/
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathExpressionImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP
|
||||
|
||||
#include <xercesc/util/XMemory.hpp>
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
#include <xercesc/dom/DOMXPathExpression.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMElement;
|
||||
class XercesXPath;
|
||||
class XPathMatcher;
|
||||
class DOMXPathResultImpl;
|
||||
class DOMXPathNSResolver;
|
||||
class XMLStringPool;
|
||||
|
||||
class CDOM_EXPORT DOMXPathExpressionImpl : public XMemory,
|
||||
public DOMXPathExpression
|
||||
{
|
||||
public:
|
||||
DOMXPathExpressionImpl(const XMLCh *expression,
|
||||
const DOMXPathNSResolver *resolver,
|
||||
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
virtual ~DOMXPathExpressionImpl();
|
||||
|
||||
virtual DOMXPathResult* evaluate(const DOMNode *contextNode,
|
||||
DOMXPathResult::ResultType type,
|
||||
DOMXPathResult* result) const;
|
||||
|
||||
virtual void release();
|
||||
|
||||
protected:
|
||||
bool testNode(XPathMatcher* matcher,
|
||||
DOMXPathResultImpl* result,
|
||||
DOMElement *node) const;
|
||||
void cleanUp();
|
||||
|
||||
XMLStringPool* fStringPool;
|
||||
XercesXPath* fParsedExpression;
|
||||
XMLCh* fExpression;
|
||||
bool fMoveToRoot;
|
||||
|
||||
MemoryManager* const fMemoryManager;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathNSResolverImpl.hpp 657774 2008-05-19 09:59:33Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP
|
||||
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/XMemory.hpp>
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
#include <xercesc/dom/DOMXPathNSResolver.hpp>
|
||||
#include <xercesc/util/KVStringPair.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class DOMNode;
|
||||
|
||||
class CDOM_EXPORT DOMXPathNSResolverImpl : public XMemory,
|
||||
public DOMXPathNSResolver
|
||||
{
|
||||
public:
|
||||
DOMXPathNSResolverImpl(const DOMNode* nodeResolver = 0, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMXPathNSResolverImpl();
|
||||
|
||||
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const;
|
||||
virtual const XMLCh* lookupPrefix(const XMLCh* URI) const;
|
||||
virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri);
|
||||
|
||||
virtual void release();
|
||||
|
||||
protected:
|
||||
RefHashTableOf<KVStringPair>* fNamespaceBindings;
|
||||
const DOMNode* fResolverNode;
|
||||
MemoryManager* fManager;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: DOMXPathResultImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP
|
||||
|
||||
#include <xercesc/util/XMemory.hpp>
|
||||
#include <xercesc/dom/DOMXPathResult.hpp>
|
||||
#include <xercesc/util/RefVectorOf.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class CDOM_EXPORT DOMXPathResultImpl : public XMemory,
|
||||
public DOMXPathResult
|
||||
{
|
||||
public:
|
||||
DOMXPathResultImpl(ResultType type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
||||
~DOMXPathResultImpl();
|
||||
|
||||
virtual ResultType getResultType() const;
|
||||
virtual const DOMTypeInfo *getTypeInfo() const;
|
||||
virtual bool isNode() const;
|
||||
virtual bool getBooleanValue() const;
|
||||
virtual int getIntegerValue() const;
|
||||
virtual double getNumberValue() const;
|
||||
virtual const XMLCh* getStringValue() const;
|
||||
virtual DOMNode* getNodeValue() const;
|
||||
virtual bool iterateNext();
|
||||
virtual bool getInvalidIteratorState() const;
|
||||
virtual bool snapshotItem(XMLSize_t);
|
||||
virtual XMLSize_t getSnapshotLength() const;
|
||||
|
||||
virtual void release();
|
||||
|
||||
public:
|
||||
void reset(ResultType type);
|
||||
void addResult(DOMNode* node);
|
||||
|
||||
protected:
|
||||
ResultType fType;
|
||||
MemoryManager* const fMemoryManager;
|
||||
RefVectorOf<DOMNode>* fSnapshot;
|
||||
XMLSize_t fIndex;
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: XSDElementNSImpl.hpp 672232 2008-06-27 10:16:38Z borisk $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP
|
||||
|
||||
//
|
||||
// This file is part of the internal implementation of the C++ XML DOM.
|
||||
// It is used by TraverseSchema to store line/column information.
|
||||
// It should NOT be included or used directly by application programs.
|
||||
//
|
||||
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
|
||||
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
|
||||
// name is substituded for the *.
|
||||
//
|
||||
|
||||
|
||||
#include "DOMElementNSImpl.hpp"
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
|
||||
class CDOM_EXPORT XSDElementNSImpl: public DOMElementNSImpl {
|
||||
protected:
|
||||
XMLFileLoc fLineNo; //Line number
|
||||
XMLFileLoc fColumnNo; //Column number
|
||||
|
||||
|
||||
public:
|
||||
XSDElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
|
||||
XSDElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2
|
||||
const XMLCh *namespaceURI,
|
||||
const XMLCh *qualifiedName,
|
||||
const XMLFileLoc lineNo,
|
||||
const XMLFileLoc columnNo);
|
||||
XSDElementNSImpl(const XSDElementNSImpl &other, bool deep=false);
|
||||
|
||||
virtual DOMNode * cloneNode(bool deep) const;
|
||||
|
||||
XMLFileLoc getLineNo() const { return fLineNo; }
|
||||
XMLFileLoc getColumnNo() const { return fColumnNo; }
|
||||
|
||||
private:
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented constructors and operators
|
||||
// -----------------------------------------------------------------------
|
||||
XSDElementNSImpl& operator=(const XSDElementNSImpl&);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: BinOutputStream.hpp 553915 2007-07-06 14:57:08Z amassari $
|
||||
*/
|
||||
|
||||
#if !defined(XERCESC_INCLUDE_GUARD_BIN_OUTPUT_STREAM_HPP)
|
||||
#define XERCESC_INCLUDE_GUARD_BIN_OUTPUT_STREAM_HPP
|
||||
|
||||
#include <xercesc/util/XMemory.hpp>
|
||||
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
|
||||
class XMLUTIL_EXPORT BinOutputStream : public XMemory
|
||||
{
|
||||
public :
|
||||
// -----------------------------------------------------------------------
|
||||
// Virtual destructor for derived classes
|
||||
// -----------------------------------------------------------------------
|
||||
virtual ~BinOutputStream();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// The virtual output stream interface
|
||||
// -----------------------------------------------------------------------
|
||||
virtual XMLFilePos curPos() const = 0;
|
||||
|
||||
virtual void writeBytes
|
||||
(
|
||||
const XMLByte* const toGo
|
||||
, const XMLSize_t maxToWrite
|
||||
) = 0;
|
||||
|
||||
protected :
|
||||
// -----------------------------------------------------------------------
|
||||
// Hidden Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
BinOutputStream();
|
||||
|
||||
|
||||
private :
|
||||
// -----------------------------------------------------------------------
|
||||
// Unimplemented Constructors
|
||||
// -----------------------------------------------------------------------
|
||||
BinOutputStream(const BinOutputStream&);
|
||||
BinOutputStream& operator=(const BinOutputStream&);
|
||||
};
|
||||
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user