1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-10-18 17:07:17 +02:00

Update POCO library.

This commit is contained in:
Sandu Liviu Catalin
2023-03-23 20:19:11 +02:00
parent 8d15f4b6e9
commit 233fc103f9
2521 changed files with 257092 additions and 72789 deletions

View File

@@ -31,7 +31,7 @@ namespace XML {
class XML_API Attr: public AbstractNode
/// The Attr interface represents an attribute in an Element object. Typically
/// the allowable values for the attribute are defined in a document type definition.
///
///
/// Attr objects inherit the Node interface, but since they are not actually
/// child nodes of the element they describe, the DOM does not consider them
/// part of the document tree. Thus, the Node attributes parentNode, previousSibling,
@@ -44,7 +44,7 @@ class XML_API Attr: public AbstractNode
/// nodes contained within a DocumentFragment. In short, users and implementors
/// of the DOM need to be aware that Attr nodes have some things in common with
/// other objects inheriting the Node interface, but they also are quite distinct.
///
///
/// The attribute's effective value is determined as follows: if this attribute
/// has been explicitly assigned any value, that value is the attribute's effective
/// value; otherwise, if there is a declaration for this attribute, and that
@@ -53,7 +53,7 @@ class XML_API Attr: public AbstractNode
/// in the structure model until it has been explicitly added. Note that the
/// nodeValue attribute on the Attr instance can also be used to retrieve the
/// string version of the attribute's value(s).
///
///
/// In XML, where the value of an attribute can contain entity references, the
/// child nodes of the Attr node provide a representation in which entity references
/// are not expanded. These child nodes may be either Text or EntityReference
@@ -74,7 +74,7 @@ public:
/// attribute. The implementation will then make a new attribute available with
/// specified set to false and the default value (if one exists).
/// In summary:
///
///
/// * If the attribute has an assigned value in the document then specified
/// is true, and the value is the assigned value.
/// * If the attribute has no assigned value in the document and has a default
@@ -106,7 +106,7 @@ public:
// DOM Level 2
Element* ownerElement() const;
/// The Element node this attribute is attached to or null
/// The Element node this attribute is attached to or null
/// if this attribute is not in use.
// Node
@@ -127,7 +127,7 @@ protected:
Attr(Document* pOwnerDocument, Element* pOwnerElement, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& value, bool specified = true);
Attr(Document* pOwnerDocument, const Attr& attr);
~Attr();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:

View File

@@ -54,7 +54,7 @@ private:
AttrMap();
Element* _pElement;
friend class Element;
};

View File

@@ -32,17 +32,17 @@ class XML_API CDATASection: public Text
/// 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.
///
///
/// The DOMString attribute of the Text 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.
///
///
/// The CDATASection interface inherits from the CharacterData interface through
/// the Text interface. Adjacent CDATASection nodes are not merged by use of
/// the normalize method on the Element interface.
///
///
/// Note: Because no markup is recognized within a CDATASection, character numeric
/// references cannot be used as an escape mechanism when serializing. Therefore,
/// action needs to be taken when serializing a CDATASection with a character
@@ -73,7 +73,7 @@ protected:
private:
static const XMLString NODE_NAME;
friend class Document;
};

View File

@@ -33,18 +33,18 @@ class XML_API CharacterData: public AbstractNode
/// here rather than on each object that uses these attributes and methods.
/// No DOM objects correspond directly to CharacterData, though Text and others
/// do inherit the interface from it. All offsets in this interface start from 0.
///
///
/// Text strings in the DOM are represented in either UTF-8 (if XML_UNICODE_WCHAR_T is
/// not defined) or in UTF-16 (if XML_UNICODE_WCHAR_T is defined).
/// Indexing on character data is done in XMLChar units.
{
public:
const XMLString& data() const;
/// Returns the character data of the node that
/// Returns the character data of the node that
/// implements the interface.
const XMLString& getData() const;
/// Returns the character data of the node that
/// Returns the character data of the node that
/// implements the interface.
void setData(const XMLString& data);

View File

@@ -39,12 +39,12 @@ public:
protected:
ChildNodesList(const Node* pParent);
~ChildNodesList();
private:
ChildNodesList();
const Node* _pParent;
friend class AbstractNode;
};

View File

@@ -47,7 +47,7 @@ protected:
private:
static const XMLString NODE_NAME;
friend class Document;
};

View File

@@ -47,7 +47,7 @@ class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protec
{
public:
DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0);
/// Creates a DOMBuilder using the given XMLReader.
/// Creates a DOMBuilder using the given XMLReader.
/// If a NamePool is given, it becomes the Document's NamePool.
virtual ~DOMBuilder();
@@ -87,10 +87,10 @@ protected:
void endEntity(const XMLString& name);
void startCDATA();
void endCDATA();
void comment(const XMLChar ch[], int start, int length);
void comment(const XMLChar ch[], int start, int length);
void appendNode(AbstractNode* pNode);
void setupParse();
private:

View File

@@ -32,7 +32,7 @@ class XML_API DOMException: public XMLException
/// 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 NodeList.
///
///
/// Implementations should raise other exceptions under other circumstances.
/// For example, implementations should raise an implementation-dependent exception
/// if a null argument is passed when null was not expected.
@@ -55,19 +55,19 @@ public:
INVALID_MODIFICATION_ERR, /// an attempt is made to modify the type of the underlying object
NAMESPACE_ERR, /// an attempt is made to create or change an object in a way which is incorrect with regard to namespaces
INVALID_ACCESS_ERR, /// an attempt is made to use an object that is not, or is no longer, usable
_NUMBER_OF_MESSAGES
};
DOMException(unsigned short code);
/// Creates a DOMException with the given error code.
DOMException(const DOMException& exc);
/// Creates a DOMException by copying another one.
~DOMException() noexcept;
/// Destroys the DOMException.
DOMException& operator = (const DOMException& exc);
const char* name() const noexcept;
@@ -78,7 +78,7 @@ public:
Poco::Exception* clone() const;
/// Creates an exact copy of the exception.
void rethrow() const;
/// (Re)Throws the exception.
@@ -87,12 +87,12 @@ public:
protected:
static const std::string& message(unsigned short code);
private:
DOMException();
unsigned short _code;
static const std::string MESSAGES[_NUMBER_OF_MESSAGES];
};

View File

@@ -40,20 +40,20 @@ class XML_API DOMImplementation
public:
DOMImplementation();
/// Creates the DOMImplementation.
~DOMImplementation();
/// Destroys the DOMImplementation.
bool hasFeature(const XMLString& feature, const XMLString& version) const;
/// Tests if the DOM implementation implements a specific feature.
///
/// The only supported features are "XML", version "1.0" and "Core",
/// The only supported features are "XML", version "1.0" and "Core",
/// "Events", "MutationEvents" and "Traversal", version "2.0".
// DOM Level 2
DocumentType* createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const;
/// Creates an empty DocumentType node. Entity declarations and notations
/// are not made available. Entity reference expansions and default attribute
/// Creates an empty DocumentType node. Entity declarations and notations
/// are not made available. Entity reference expansions and default attribute
/// additions do not occur.
Document* createDocument(const XMLString& namespaceURI, const XMLString& qualifiedName, DocumentType* doctype) const;
@@ -64,7 +64,7 @@ public:
static const DOMImplementation& instance();
/// Returns a reference to the default DOMImplementation
/// object.
private:
static const XMLString FEATURE_XML;
static const XMLString FEATURE_CORE;
@@ -72,7 +72,7 @@ private:
static const XMLString FEATURE_MUTATIONEVENTS;
static const XMLString FEATURE_TRAVERSAL;
static const XMLString VERSION_1_0;
static const XMLString VERSION_2_0;
static const XMLString VERSION_2_0;
};

View File

@@ -62,7 +62,7 @@ public:
/// Decreases the object's reference count.
/// If the reference count reaches zero,
/// the object is deleted.
virtual void autoRelease() = 0;
/// Adds the object to an appropriate
/// AutoReleasePool, which is usually the
@@ -76,7 +76,7 @@ protected:
private:
DOMObject(const DOMObject&);
DOMObject& operator = (const DOMObject&);
mutable int _rc;
};

View File

@@ -39,13 +39,13 @@ class XML_API DOMParser
{
public:
explicit DOMParser(NamePool* pNamePool = 0);
/// Creates a new DOMParser.
/// Creates a new DOMParser.
/// If a NamePool is given, it becomes the Document's NamePool.
explicit DOMParser(unsigned long namePoolSize);
/// Creates a new DOMParser, using the given NamePool size.
///
/// The given namePoolSize should be a suitable prime number,
/// The given namePoolSize should be a suitable prime number,
/// e.g. 251, 509, 1021 or 4093, depending on the expected
/// size of the document.
@@ -55,7 +55,7 @@ public:
void setEncoding(const XMLString& encoding);
/// Sets the encoding used by the parser if no
/// encoding is specified in the XML document.
const XMLString& getEncoding() const;
/// Returns the name of the encoding used by
/// the parser if no encoding is specified in
@@ -100,7 +100,7 @@ public:
/// Sets the entity resolver on the underlying SAXParser.
static const XMLString FEATURE_FILTER_WHITESPACE;
private:
SAXParser _saxParser;
NamePool* _pNamePool;

View File

@@ -52,10 +52,10 @@ class XML_API DOMSerializer: public XMLReader
public:
DOMSerializer();
/// Creates the DOMSerializer.
~DOMSerializer();
/// Destroys the DOMSerializer.
void serialize(const Node* pNode);
/// Serializes a DOM node and its children
/// into a sequence of SAX events, which are
@@ -82,7 +82,7 @@ protected:
void parse(InputSource* pSource);
/// The DOMSerializer cannot parse an InputSource,
/// so this method simply throws an XMLException when invoked.
void parse(const XMLString& systemId);
/// The DOMSerializer cannot parse from a system identifier,
/// so this method simply throws an XMLException when invoked.
@@ -111,7 +111,7 @@ private:
ErrorHandler* _pErrorHandler;
DeclHandler* _pDeclHandler;
LexicalHandler* _pLexicalHandler;
static const XMLString CDATA;
};

View File

@@ -40,7 +40,7 @@ class XML_API DOMWriter
public:
DOMWriter();
/// Creates a DOMWriter.
~DOMWriter();
/// Destroys a DOMWriter.
@@ -61,7 +61,7 @@ public:
void setNewLine(const std::string& newLine);
/// Sets the line ending characters for the internal
/// XMLWriter. See XMLWriter::setNewLine() for a list
/// of supported values.
/// of supported values.
const std::string& getNewLine() const;
/// Returns the line ending characters used by the
@@ -74,7 +74,7 @@ public:
/// The given string should only contain TAB or SPACE
/// characters (e.g., a single TAB character, or
/// two to four SPACE characters).
const std::string& getIndent() const;
/// Returns the string used for one indentation step.

View File

@@ -32,7 +32,7 @@ class DocumentType;
class XML_API DTDMap: public NamedNodeMap
/// This implementation of NamedNodeMap
/// is returned by DocumentType::entities()
/// and DocumentType::notations().
/// and DocumentType::notations().
{
public:
Node* getNamedItem(const XMLString& name) const;
@@ -53,10 +53,10 @@ protected:
private:
DTDMap();
const DocumentType* _pDocumentType;
unsigned short _type;
friend class DocumentType;
};

View File

@@ -47,14 +47,14 @@ class Notation;
class XML_API Document: public AbstractContainerNode, public DocumentEvent
/// The Document interface represents the entire HTML or XML document. Conceptually,
/// it is the root of the document tree, and provides the primary access to the
/// The Document interface represents the entire HTML or XML document. Conceptually,
/// it is the root of the document tree, and provides the primary access to the
/// document's data.
///
/// Since elements, text nodes, comments, processing instructions, etc. cannot exist
/// outside the context of a Document, the Document interface also contains the
/// factory methods needed to create these objects. The Node objects created have a
/// ownerDocument attribute which associates them with the Document within whose
/// Since elements, text nodes, comments, processing instructions, etc. cannot exist
/// outside the context of a Document, the Document interface also contains the
/// factory methods needed to create these objects. The Node objects created have a
/// ownerDocument attribute which associates them with the Document within whose
/// context they were created.
{
public:
@@ -65,7 +65,7 @@ public:
/// creates its own name pool, otherwise it uses the given name pool.
/// Sharing a name pool makes sense for documents containing instances
/// of the same schema, thus reducing memory usage.
explicit Document(unsigned long namePoolSize);
/// Creates a new document using a name pool with the given size, which
/// should be a prime number (e.g., 251, 509, 1021, 4093).
@@ -141,9 +141,9 @@ public:
ProcessingInstruction* createProcessingInstruction(const XMLString& target, const XMLString& data) const;
/// Creates a ProcessingInstruction node given the specified target and data strings.
Attr* createAttribute(const XMLString& name) const;
Attr* createAttribute(const XMLString& name) const;
/// Creates an Attr of the given name. Note that the Attr instance can then
/// be set on an Element using the setAttributeNode method.
/// be set on an Element using the setAttributeNode method.
EntityReference* createEntityReference(const XMLString& name) const;
/// Creates an EntityReference object. In addition, if the referenced entity
@@ -181,18 +181,18 @@ public:
/// Creates an attribute of the given qualified name and namespace URI.
NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns a NodeList of all the Elements with a given local name and
/// namespace URI in the order in which they are encountered in a
/// Returns a NodeList of all the Elements with a given local name and
/// namespace URI in the order in which they are encountered in a
/// preorder traversal of the Document tree.
Element* getElementById(const XMLString& elementId) const;
/// Returns the Element whose ID is given by elementId. If no such
/// Returns the Element whose ID is given by elementId. If no such
/// element exists, returns null. Behavior is not defined if more
/// than one element has this ID.
/// than one element has this ID.
///
/// Note: The DOM implementation must have information that says
/// Note: 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
/// 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 null. This implementation therefore returns null.
///
@@ -208,7 +208,7 @@ public:
// EventTarget
bool dispatchEvent(Event* evt);
// Extensions
Entity* createEntity(const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName) const;
/// Creates an Entity with the given name, publicId, systemId and notationName.
@@ -222,13 +222,13 @@ public:
Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
/// Returns the first Element whose ID attribute (given in idAttribute)
/// has the given elementId. If no such element exists, returns null.
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
/// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
/// has the given elementId. If no such element exists, returns null.
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
@@ -236,7 +236,7 @@ protected:
~Document();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
DocumentType* getDoctype();
void setDoctype(DocumentType* pDoctype);
@@ -247,7 +247,7 @@ private:
int _eventSuspendLevel;
static const XMLString NODE_NAME;
friend class DOMBuilder;
};

View File

@@ -37,12 +37,12 @@ class XML_API DocumentFragment: public AbstractContainerNode
/// could fulfill this role, a Document object can potentially be a heavyweight
/// object, depending on the underlying implementation. What is really needed
/// for this is a very lightweight object. DocumentFragment is such an object.
///
///
/// Furthermore, various operations -- such as inserting nodes as children of
/// another Node -- may take DocumentFragment objects as arguments; this results
/// in all the child nodes of the DocumentFragment being moved to the child
/// list of this node.
///
///
/// The children of a DocumentFragment node are zero or more nodes representing
/// the tops of any sub-trees defining the structure of the document. DocumentFragment
/// nodes do not need to be well-formed XML documents (although they do need
@@ -50,7 +50,7 @@ class XML_API DocumentFragment: public AbstractContainerNode
/// can have multiple top nodes). For example, a DocumentFragment might have
/// only one child and that child node could be a Text node. Such a structure
/// model represents neither an HTML document nor a well-formed XML document.
///
///
/// When a DocumentFragment is inserted into a Document (or indeed any other
/// Node that may take children) the children of the DocumentFragment and not
/// the DocumentFragment itself are inserted into the Node. This makes the DocumentFragment
@@ -68,12 +68,12 @@ protected:
DocumentFragment(Document* pOwnerDocument);
DocumentFragment(Document* pOwnerDocument, const DocumentFragment& fragment);
~DocumentFragment();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
static const XMLString NODE_NAME;
friend class Document;
};

View File

@@ -35,12 +35,12 @@ class XML_API DocumentType: public AbstractContainerNode
/// interface to the list of entities that are defined for the document, and
/// little else because the effect of namespaces and the various XML scheme
/// efforts on DTD representation are not clearly understood as of this writing.
///
///
/// The DOM Level 1 doesn't support editing DocumentType nodes.
{
public:
const XMLString& name() const;
/// The name of the DTD; i.e., the name immediately following the
/// The name of the DTD; i.e., the name immediately following the
/// DOCTYPE keyword.
NamedNodeMap* entities() const;
@@ -52,7 +52,7 @@ public:
/// external entities are reported.
/// Every node in this map also implements the
/// Entity interface.
///
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
@@ -61,7 +61,7 @@ public:
/// are discarded. Every node in this map also implements the Notation interface.
/// The DOM Level 1 does not support editing notations, therefore notations
/// cannot be altered in any way.
///
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
@@ -91,7 +91,7 @@ private:
XMLString _name;
XMLString _publicId;
XMLString _systemId;
friend class DOMImplementation;
friend class Document;
friend class DOMBuilder;

View File

@@ -40,19 +40,19 @@ class XML_API Element: public AbstractContainerNode
/// methods on the Element interface to retrieve either an Attr object by name
/// or an attribute value by name. In XML, where an attribute value may contain
/// entity references, an Attr object should be retrieved to examine the possibly
/// fairly complex sub-tree representing the attribute value.
/// fairly complex sub-tree representing the attribute value.
{
public:
const XMLString& tagName() const;
/// Returns the name of the element.
///
/// For example, in
///
/// <elementExample id="demo">
/// ...
///
/// <elementExample id="demo">
/// ...
/// </elementExample>
///
/// tagName has the value "elementExample". Note that this is case-preserving in XML,
/// tagName has the value "elementExample". Note that this is case-preserving in XML,
/// as are all of the operations of the DOM.
const XMLString& getAttribute(const XMLString& name) const;
@@ -68,7 +68,7 @@ public:
/// 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.
void removeAttribute(const XMLString& name);
/// Removes an attribute by name.
@@ -107,7 +107,7 @@ public:
/// 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.
///
///
/// Note: In cases where the document contains CDATASections, the normalize
/// operation alone may not be sufficient, since XPointers do not differentiate
/// between Text nodes and CDATASection nodes.
@@ -141,7 +141,7 @@ public:
/// Returns true if and only if the element has the specified attribute.
NodeList* getElementsByTagNameNS(const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns a NodeList of all the descendant Elements with a given local name and namespace URI
/// Returns a NodeList of all the descendant Elements with a given local name and namespace URI
/// in the order in which they are encountered in a preorder traversal of this Element tree.
///
/// The special value "*" matches all namespaces, or local names respectively.
@@ -166,19 +166,19 @@ public:
/// or null if such an element does not exist.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementById(const XMLString& elementId, const XMLString& idAttribute) const;
/// Returns the first Element whose ID attribute (given in idAttribute)
/// has the given elementId. If no such element exists, returns null.
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
Element* getElementByIdNS(const XMLString& elementId, const XMLString& idAttributeURI, const XMLString& idAttributeLocalName) const;
/// Returns the first Element whose ID attribute (given in idAttributeURI and idAttributeLocalName)
/// has the given elementId. If no such element exists, returns null.
/// has the given elementId. If no such element exists, returns null.
///
/// This method is an extension to the W3C Document Object Model.
// Node
const XMLString& nodeName() const;
NamedNodeMap* attributes() const;

View File

@@ -46,7 +46,7 @@ protected:
const Node* _pParent;
XMLString _name;
mutable unsigned long _count;
friend class AbstractContainerNode;
friend class Element;
friend class Document;
@@ -73,7 +73,7 @@ protected:
XMLString _localName;
XMLString _namespaceURI;
mutable unsigned long _count;
friend class AbstractContainerNode;
friend class Element;
friend class Document;

View File

@@ -32,14 +32,14 @@ class XML_API Entity: public AbstractContainerNode
/// document. Note that this models the entity itself not the entity declaration.
/// Entity declaration modeling has been left for a later Level of the DOM
/// specification.
///
///
/// The nodeName attribute that is inherited from Node contains the name of
/// the entity.
///
///
/// 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 EntityReference
/// nodes in the document tree.
///
///
/// 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
@@ -47,17 +47,17 @@ class XML_API Entity: public AbstractContainerNode
/// replacement value of the entity may not be available. When the replacement
/// value is available, the corresponding Entity node's child list represents
/// the structure of that replacement text. Otherwise, the child list is empty.
///
///
/// The resolution of the children of the Entity (the replacement value) may
/// be lazily evaluated; actions by the user (such as calling the childNodes
/// method on the Entity Node) are assumed to trigger the evaluation.
///
///
/// The DOM Level 1 does not support editing Entity nodes; if a user wants to
/// make changes to the contents of an Entity, every related EntityReference
/// node has to be replaced in the structure model by a clone of the Entity's
/// contents, and then the desired changes must be made to each of those clones
/// instead. Entity nodes and all their descendants are readonly.
///
///
/// An Entity node does not have any parent.
{
public:
@@ -84,7 +84,7 @@ protected:
Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName);
Entity(Document* pOwnerDocument, const Entity& entity);
~Entity();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:

View File

@@ -39,10 +39,10 @@ class XML_API EntityReference: public AbstractNode
/// node, it may be that there is no Entity node representing the referenced
/// entity. If such an Entity exists, then the child list of the EntityReference
/// node is the same as that of the Entity node.
///
///
/// As for Entity nodes, EntityReference nodes and all their descendants are
/// readonly.
///
///
/// The resolution of the children of the EntityReference (the replacement value
/// of the referenced Entity) may be lazily evaluated; actions by the user (such
/// as calling the childNodes method on the EntityReference node) are assumed
@@ -62,7 +62,7 @@ protected:
private:
XMLString _name;
friend class Document;
};

View File

@@ -43,9 +43,9 @@ class XML_API Event: public DOMObject
public:
enum PhaseType
{
CAPTURING_PHASE = 1, /// The event is currently being evaluated at the target EventTarget.
AT_TARGET = 2, /// The current event phase is the bubbling phase.
BUBBLING_PHASE = 3 /// The current event phase is the capturing phase.
CAPTURING_PHASE = 1, /// The event is currently being evaluated at the target EventTarget.
AT_TARGET = 2, /// The current event phase is the bubbling phase.
BUBBLING_PHASE = 3 /// The current event phase is the capturing phase.
};
const XMLString& type() const;
@@ -55,59 +55,59 @@ public:
/// Used to indicate the EventTarget to which the event was originally dispatched.
EventTarget* currentTarget() const;
/// Used to indicate the EventTarget whose EventListeners are currently being
/// Used to indicate the EventTarget whose EventListeners are currently being
/// processed. This is particularly useful during capturing and bubbling.
PhaseType eventPhase() const;
/// Used to indicate which phase of event flow is currently being evaluated.
bool bubbles() const;
/// Used to indicate whether or not an event is a bubbling event.
/// Used to indicate whether or not an event is a bubbling event.
/// If the event can bubble the value is true, else the value is false.
bool cancelable() const;
/// Used to indicate whether or not an event can have its default action
/// Used to indicate whether or not an event can have its default action
/// prevented. If the default action can be prevented the value is
/// true, else the value is false.
Poco::UInt64 timeStamp() const;
/// Used to specify the time (in milliseconds relative to the epoch) at
/// Used to specify the time (in milliseconds relative to the epoch) at
/// which the event was created. Due to the fact that some
/// systems may not provide this information the value of timeStamp may
/// systems may not provide this information the value of timeStamp may
/// be not available for all events. When not available, a
/// value of 0 will be returned. Examples of epoch time are the time of the
/// value of 0 will be returned. Examples of epoch time are the time of the
/// system start or 0:0:0 UTC 1st January 1970.
/// This implementation always returns 0.
void stopPropagation();
/// The stopPropagation method is used prevent further propagation of an
/// The stopPropagation method is used prevent further propagation of an
/// event during event flow. If this method is called by
/// any EventListener the event will cease propagating through the tree.
/// any EventListener the event will cease propagating through the tree.
/// The event will complete dispatch to all listeners on the
/// current EventTarget before event flow stops. This method may be used
/// during any stage of event flow.
/// current EventTarget before event flow stops. This method may be used
/// during any stage of event flow.
void preventDefault();
/// If an event is cancelable, the preventDefault method is used to signify
/// If an event is cancelable, the preventDefault method is used to signify
/// that the event is to be canceled, meaning any default
/// action normally taken by the implementation as a result of
/// action normally taken by the implementation as a result of
/// the event will not occur. If, during any stage of event flow, the
/// preventDefault method is called the event is canceled. Any default
/// preventDefault method is called the event is canceled. Any default
/// action associated with the event will not occur. Calling
/// this method for a non-cancelable event has no effect. Once
/// this method for a non-cancelable event has no effect. Once
/// preventDefault has been called it will remain in effect throughout
/// the remainder of the event's propagation. This method may be
/// used during any stage of event flow.
/// the remainder of the event's propagation. This method may be
/// used during any stage of event flow.
void initEvent(const XMLString& eventType, bool canBubble, bool isCancelable);
/// The initEvent method is used to initialize the value of an
/// The initEvent method is used to initialize the value of an
/// Event created through the DocumentEvent interface. This method
/// may only be called before the Event has been dispatched via the
/// may only be called before the Event has been dispatched via the
/// dispatchEvent method, though it may be called multiple
/// times during that phase if necessary. If called multiple
/// times the final invocation takes precedence. If called from
/// a subclass of Event interface only the values specified in the
/// initEvent method are modified, all other attributes are left unchanged.
/// times during that phase if necessary. If called multiple
/// times the final invocation takes precedence. If called from
/// a subclass of Event interface only the values specified in the
/// initEvent method are modified, all other attributes are left unchanged.
void autoRelease();
@@ -141,7 +141,7 @@ private:
bool _cancelable;
bool _canceled;
bool _stopped;
friend class AbstractNode;
};

View File

@@ -43,13 +43,13 @@ class XML_API EventDispatcher
public:
EventDispatcher();
/// Creates the EventDispatcher.
~EventDispatcher();
/// Destroys the EventDispatcher.
void addEventListener(const XMLString& type, EventListener* listener, bool useCapture);
/// Adds an EventListener to the internal list.
void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture);
/// Removes an EventListener from the internal list.
///
@@ -61,19 +61,19 @@ public:
void dispatchEvent(Event* evt);
/// Dispatches the event.
///
/// Also removes all EventListeners marked for deletion from the
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
void captureEvent(Event* evt);
/// Dispatches the event in its capturing phase.
///
/// Also removes all EventListeners marked for deletion from the
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
void bubbleEvent(Event* evt);
/// Dispatches the event in its bubbling phase.
///
/// Also removes all EventListeners marked for deletion from the
/// Also removes all EventListeners marked for deletion from the
/// event dispatcher list.
private:
@@ -85,7 +85,7 @@ private:
};
typedef std::list<EventListenerItem> EventListenerList;
int _inDispatch;
EventListenerList _listeners;
};

View File

@@ -27,15 +27,15 @@ namespace XML {
class XML_API EventException: public XMLException
/// Event operations may throw an EventException as
/// Event operations may throw an EventException as
/// specified in their method descriptions.
{
public:
enum
{
UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the
UNSPECIFIED_EVENT_TYPE_ERR = 0 /// If the Event's type was not specified by initializing the
/// event before the method was called. Specification of the Event's
/// type as null or an empty string will also trigger this exception.
/// type as null or an empty string will also trigger this exception.
};
EventException(int code);
@@ -60,7 +60,7 @@ public:
protected:
Poco::Exception* clone() const;
private:
EventException();
};

View File

@@ -35,7 +35,7 @@ class XML_API EventListener
/// EventTarget using the AddEventListener method. The users should also remove
/// their EventListener from its EventTarget after they have completed using
/// the listener.
///
///
/// When a Node is copied using the cloneNode method the EventListeners attached
/// to the source Node are not attached to the copied Node. If the user wishes
/// the same EventListeners to be added to the newly created copy the user must
@@ -43,7 +43,7 @@ class XML_API EventListener
{
public:
virtual void handleEvent(Event* evt) = 0;
/// This method is called whenever an event occurs of the
/// This method is called whenever an event occurs of the
/// type for which the EventListener interface was registered.
protected:

View File

@@ -40,30 +40,30 @@ class XML_API EventTarget: public DOMObject
{
public:
virtual void addEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
/// This method allows the registration of event listeners on
/// This method allows the registration of event listeners on
/// the event target. If an EventListener is added to an
/// EventTarget while it is processing an event, it will not
/// EventTarget while it is processing an event, it will not
/// be triggered by the current actions but may be triggered
/// during a later stage of event flow, such as the bubbling phase.
/// If multiple identical EventListeners are registered on the same
/// EventTarget with the same parameters the duplicate instances are
/// If multiple identical EventListeners are registered on the same
/// EventTarget with the same parameters the duplicate instances are
/// discarded. They do not cause the EventListener to be called twice and since they are
/// discarded they do not need to be removed with the removeEventListener method.
/// discarded they do not need to be removed with the removeEventListener method.
virtual void removeEventListener(const XMLString& type, EventListener* listener, bool useCapture) = 0;
/// This method allows the removal of event listeners from the event
/// target. If an EventListener is removed from an EventTarget while it is
/// processing an event, it will not be triggered by the current actions.
/// This method allows the removal of event listeners from the event
/// target. If an EventListener is removed from an EventTarget while it is
/// processing an event, it will not be triggered by the current actions.
/// EventListeners can never be invoked after being removed.
/// Calling removeEventListener with arguments which do not identify
/// any currently registered EventListener on the EventTarget has no effect.
/// Calling removeEventListener with arguments which do not identify
/// any currently registered EventListener on the EventTarget has no effect.
virtual bool dispatchEvent(Event* evt) = 0;
/// This method allows the dispatch of events into the implementations
/// event model. Events dispatched in this manner will have the same capturing and
/// This method allows the dispatch of events into the implementations
/// event model. Events dispatched in this manner will have the same capturing and
/// bubbling behavior as events dispatched directly by the
/// implementation. The target of the event is the EventTarget on
/// which dispatchEvent is called.
/// implementation. The target of the event is the EventTarget on
/// which dispatchEvent is called.
protected:
virtual ~EventTarget();

View File

@@ -30,49 +30,49 @@ class Node;
class XML_API MutationEvent: public Event
/// The MutationEvent interface provides specific contextual
/// The MutationEvent interface provides specific contextual
/// information associated with Mutation events.
{
public:
enum AttrChangeType
{
MODIFICATION = 1, /// The Attr was modified in place.
ADDITION = 2, /// The Attr was just added.
REMOVAL = 3 /// The Attr was just removed.
ADDITION = 2, /// The Attr was just added.
REMOVAL = 3 /// The Attr was just removed.
};
Node* relatedNode() const;
/// relatedNode is used to identify a secondary node related to a mutation
/// relatedNode is used to identify a secondary node related to a mutation
/// event. For example, if a mutation event is dispatched
/// to a node indicating that its parent has changed, the relatedNode is the
/// to a node indicating that its parent has changed, the relatedNode is the
/// changed parent. If an event is instead dispatched to a
/// subtree indicating a node was changed within it, the relatedNode is
/// subtree indicating a node was changed within it, the relatedNode is
/// the changed node. In the case of the DOMAttrModified
/// event it indicates the Attr node which was modified, added, or removed.
const XMLString& prevValue() const;
/// prevValue indicates the previous value of the Attr node in DOMAttrModified
/// prevValue indicates the previous value of the Attr node in DOMAttrModified
/// events, and of the CharacterData node in DOMCharDataModified events.
const XMLString& newValue() const;
/// newValue indicates the new value of the Attr node in DOMAttrModified
/// newValue indicates the new value of the Attr node in DOMAttrModified
/// events, and of the CharacterData node in DOMCharDataModified events.
const XMLString& attrName() const;
/// attrName indicates the name of the changed Attr node in a DOMAttrModified event.
AttrChangeType attrChange() const;
/// attrChange indicates the type of change which triggered the
/// attrChange indicates the type of change which triggered the
/// DOMAttrModified event. The values can be MODIFICATION,
/// ADDITION, or REMOVAL.
void initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode,
void initMutationEvent(const XMLString& type, bool canBubble, bool cancelable, Node* relatedNode,
const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
/// The initMutationEvent method is used to initialize the value of a
/// The initMutationEvent method is used to initialize the value of a
/// MutationEvent created through the DocumentEvent
/// interface. This method may only be called before the MutationEvent
/// interface. This method may only be called before the MutationEvent
/// has been dispatched via the dispatchEvent method,
/// though it may be called multiple times during that phase if
/// though it may be called multiple times during that phase if
/// necessary. If called multiple times, the final invocation takes
/// precedence.
@@ -88,7 +88,7 @@ public:
protected:
MutationEvent(Document* pOwnerDocument, const XMLString& type);
MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode);
MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode,
MutationEvent(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarget, bool canBubble, bool cancelable, Node* relatedNode,
const XMLString& prevValue, const XMLString& newValue, const XMLString& attrName, AttrChangeType change);
~MutationEvent();

View File

@@ -41,7 +41,7 @@ class XML_API NamedNodeMap: public DOMObject
///
/// NamedNodeMap objects in the DOM are live.
///
/// A NamedNodeMap returned from a method must be released with a call to
/// A NamedNodeMap returned from a method must be released with a call to
/// release() when no longer needed.
{
public:
@@ -69,19 +69,19 @@ public:
virtual unsigned long length() const = 0;
/// Returns the number of nodes in the map. The range of valid
/// child node indices is 0 to length - 1 inclusive.
// DOM Level 2
virtual Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const = 0;
/// Retrieves a node specified by name.
virtual Node* setNamedItemNS(Node* arg) = 0;
/// Adds a node using its nodeName attribute.
/// If a node with that namespace URI and that local name is already
/// If a node with that namespace URI and that local name is already
/// present in this map, it is replaced by the new one.
virtual Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) = 0;
/// Removes a node specified by name.
protected:
virtual ~NamedNodeMap();
};

View File

@@ -40,7 +40,7 @@ class XML_API Node: public EventTarget
/// not all objects implementing the Node interface may have children. For
/// example, Text nodes may not have children, and adding children to such
/// nodes results in a DOMException being raised.
///
///
/// The attributes nodeName, nodeValue and attributes 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
@@ -117,7 +117,7 @@ public:
virtual NamedNodeMap* attributes() const = 0;
/// Returns a NamedNodeMap containing the attributes of this
/// node (if it is an Element) or null otherwise.
///
///
/// The returned NamedNodeMap must be released with a call
/// to release() when no longer needed.
@@ -143,14 +143,14 @@ public:
virtual Node* removeChild(Node* oldChild) = 0;
/// Removes the child node indicated by oldChild from the list of children
/// and returns it.
/// and returns it.
virtual Node* appendChild(Node* newChild) = 0;
/// Appends the node newChild to the end of the list of children of this node.
/// If newChild is already in the tree, it is first removed.
virtual bool hasChildNodes() const = 0;
/// This is a convenience method to allow easy determination of whether a
/// This is a convenience method to allow easy determination of whether a
/// node has any children.
/// Returns true if the node has any children, false otherwise.
@@ -168,7 +168,7 @@ public:
/// children of an EntityReference clone are readonly. In addition, clones of
/// unspecified Attr nodes are specified. And, cloning Document, DocumentType,
/// Entity, and Notation nodes is implementation dependent.
// DOM Level 2
virtual void normalize() = 0;
/// Puts all Text nodes in the full depth of the sub-tree underneath this Node,
@@ -179,22 +179,22 @@ public:
/// 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.
///
///
/// Note: In cases where the document contains CDATASections, the normalize
/// operation alone may not be sufficient, since XPointers do not differentiate
/// between Text nodes and CDATASection nodes.
virtual bool isSupported(const XMLString& feature, const XMLString& version) const = 0;
/// Tests whether the DOM implementation implements a specific
/// Tests whether the DOM implementation implements a specific
/// feature and that feature is supported by this node.
virtual const XMLString& namespaceURI() const = 0;
/// Returns the namespace URI of the node.
/// 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
/// 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.
///
/// For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a
/// For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a
/// DOM Level 1 method, such as createElement from the Document interface, this is always the
/// empty string.
@@ -206,27 +206,27 @@ public:
virtual bool hasAttributes() const = 0;
/// Returns whether this node (if it is an element) has any attributes.
// Extensions
using NSMap = Poco::XML::NamespaceSupport;
virtual XMLString innerText() const = 0;
/// Returns a string containing the concatenated values of the node
/// and all its child nodes.
/// and all its child nodes.
///
/// This method is not part of the W3C Document Object Model.
virtual Node* getNodeByPath(const XMLString& path) const = 0;
/// Searches a node (element or attribute) based on a simplified XPath
/// Searches a node (element or attribute) based on a simplified XPath
/// expression.
///
/// Only simple XPath expressions are supported. These are the slash
/// notation for specifying paths to elements, and the square bracket
/// expression for finding elements by their index, by attribute value,
/// expression for finding elements by their index, by attribute value,
/// or finding attributes by names.
///
/// The slash at the beginning is optional, the evaluation always starts
/// at this element. A double-slash at the beginning recursively searches
/// at this element. A double-slash at the beginning recursively searches
/// the entire subtree for the first element.
///
/// Examples:
@@ -241,18 +241,18 @@ public:
/// This method is an extension to the W3C Document Object Model.
virtual Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const = 0;
/// Searches a node (element or attribute) based on a simplified XPath
/// Searches a node (element or attribute) based on a simplified XPath
/// expression. The given NSMap must contain mappings from namespace
/// prefixes to namespace URIs for all namespace prefixes used in
/// prefixes to namespace URIs for all namespace prefixes used in
/// the path expression.
///
/// Only simple XPath expressions are supported. These are the slash
/// notation for specifying paths to elements, and the square bracket
/// expression for finding elements by their index, by attribute value,
/// expression for finding elements by their index, by attribute value,
/// or finding attributes by names.
///
/// The slash at the beginning is optional, the evaluation always starts
/// at this element. A double-slash at the beginning recursively searches
/// at this element. A double-slash at the beginning recursively searches
/// the entire subtree for the first element.
///
/// Examples:

View File

@@ -37,7 +37,7 @@ class XML_API NodeAppender
/// In the DOM, child nodes are usually appended to a parent
/// node using the appendChild() method. For nodes containing
/// more than a few children, this method can be quite slow,
/// due to the way it's implemented, and because of the
/// due to the way it's implemented, and because of the
/// requirements of the DOM specification.
///
/// While the NodeAppender is being used on an Element, no
@@ -68,7 +68,7 @@ private:
NodeAppender();
NodeAppender(const NodeAppender&);
NodeAppender& operator = (const NodeAppender&);
Element* _pParent;
AbstractNode* _pLast;
};

View File

@@ -35,10 +35,10 @@ class XML_API NodeFilter
/// 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.
///
///
/// The DOM does not provide any filters. NodeFilter is just an interface that
/// users can implement to provide their own filters.
///
///
/// NodeFilters 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
@@ -61,7 +61,7 @@ public:
/// will not return this node. For both NodeIterator and TreeWalker, the children
/// of this node will still be considered.
};
enum WhatToShow
/// These are the available values for the whatToShow parameter used in TreeWalkers
/// and NodeIterators. They are the same as the set of possible types for Node,
@@ -69,18 +69,18 @@ public:
/// value of nodeType for the equivalent node type. If a bit in whatToShow is
/// set false, that will be taken as a request to skip over this type of node;
/// the behavior in that case is similar to that of FILTER_SKIP.
///
///
/// Note that if node types greater than 32 are ever introduced, they may not
/// be individually testable via whatToShow. If that need should arise, it can
/// be handled by selecting SHOW_ALL together with an appropriate NodeFilter.
{
SHOW_ALL = 0xFFFFFFFF,
/// Show all Nodes.
SHOW_ELEMENT = 0x00000001,
/// Show Element nodes.
SHOW_ATTRIBUTE = 0x00000002,
SHOW_ATTRIBUTE = 0x00000002,
/// Show Attr nodes. This is meaningful only when creating an iterator or tree-walker
/// with an attribute node as its root; in this case, it means that the attribute
/// node will appear in the first position of the iteration or traversal. Since
@@ -125,7 +125,7 @@ public:
/// notations are not part of the document tree, they do not appear when traversing
/// over the document tree.
};
virtual short acceptNode(Node* node) = 0;
/// Test whether a specified node is visible in the logical view of a TreeWalker
/// or NodeIterator. This function will be called by the implementation of TreeWalker
@@ -134,7 +134,7 @@ public:
/// logic.)
///
/// Returns FILTER_ACCEPT, FILTER_REJECT or FILTER_SKIP.
protected:
virtual ~NodeFilter();
};

View File

@@ -48,13 +48,13 @@ class XML_API NodeIterator
public:
NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
/// Creates a NodeIterator over the subtree rooted at the specified node.
NodeIterator(const NodeIterator& iterator);
/// Creates a NodeIterator by copying another NodeIterator.
NodeIterator& operator = (const NodeIterator& iterator);
/// Assignment operator.
~NodeIterator();
/// Destroys the NodeIterator.
@@ -62,10 +62,10 @@ public:
/// The root node of the NodeIterator, as specified when it was created.
unsigned long whatToShow() const;
/// This attribute determines which node types are presented via the iterator.
/// The available set of constants is defined in the NodeFilter interface.
/// Nodes not accepted by whatToShow will be skipped, but their children may
/// still be considered. Note that this skip takes precedence over the filter,
/// This attribute determines which node types are presented via the iterator.
/// The available set of constants is defined in the NodeFilter interface.
/// Nodes not accepted by whatToShow will be skipped, but their children may
/// still be considered. Note that this skip takes precedence over the filter,
/// if any.
NodeFilter* filter() const;
@@ -78,7 +78,7 @@ public:
/// and the filter. Also note that this is currently the only situation where
/// NodeIterators may reject a complete subtree rather than skipping individual
/// nodes.
///
///
/// 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 expandEntityReferences to true
@@ -120,7 +120,7 @@ protected:
private:
NodeIterator();
Node* _pRoot;
unsigned long _whatToShow;
NodeFilter* _pFilter;

View File

@@ -34,10 +34,10 @@ class XML_API NodeList: public DOMObject
/// collection of nodes, without defining or constraining how this
/// collection is implemented.
///
/// The items in the NodeList are accessible via an integral index,
/// The items in the NodeList are accessible via an integral index,
/// starting from 0.
///
/// A NodeList returned from a method must be released with a call to
/// A NodeList returned from a method must be released with a call to
/// release() when no longer needed.
{
public:
@@ -49,7 +49,7 @@ public:
virtual unsigned long length() const = 0;
/// Returns the number of nodes in the list. The range of valid
/// node indices is 0 to length - 1 inclusive.
protected:
virtual ~NodeList();
};

View File

@@ -30,15 +30,15 @@ namespace XML {
class XML_API Notation: public AbstractNode
/// 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 <http://www.w3.org/TR/2004/REC-xml-20040204/>),
/// the XML 1.0 specification <http://www.w3.org/TR/2004/REC-xml-20040204/>),
/// or is used for formal declaration of processing
/// instruction targets (see section 2.6 of the XML 1.0 specification).
/// The nodeName attribute inherited from Node is set to the declared name of
/// the notation.
///
///
/// The DOM Level 1 does not support editing Notation nodes; they are therefore
/// readonly.
///
///
/// A Notation node does not have any parent.
{
public:
@@ -60,14 +60,14 @@ protected:
Notation(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
Notation(Document* pOwnerDocument, const Notation& notation);
~Notation();
Node* copyNode(bool deep, Document* pOwnerDocument) const;
private:
XMLString _name;
XMLString _publicId;
XMLString _systemId;
friend class Document;
};

View File

@@ -39,12 +39,12 @@ public:
/// the markup that begins the processing instruction.
const XMLString& data() const;
/// Returns the content of this processing instruction. This is from the first non
/// Returns the content of this processing instruction. This is from the first non
/// white space character after the target to the character immediately preceding
/// the ?>.
const XMLString& getData() const;
/// Returns the content of this processing instruction. This is from the first non
/// Returns the content of this processing instruction. This is from the first non
/// white space character after the target to the character immediately preceding
/// the ?>.
@@ -67,7 +67,7 @@ protected:
private:
XMLString _target;
XMLString _data;
friend class Document;
};

View File

@@ -34,7 +34,7 @@ class XML_API Text: public CharacterData
/// object implementing the Text interface that is the only child of the element.
/// If there is markup, it is parsed into the information items (elements, comments,
/// etc.) and Text nodes that form the list of children of the element.
///
///
/// When a document is first made available via the DOM, there is only one Text
/// node for each block of text. Users may create adjacent Text nodes that represent
/// the contents of a given element without any intervening markup, but should
@@ -68,7 +68,7 @@ protected:
private:
static const XMLString NODE_NAME;
friend class Document;
};

View File

@@ -35,7 +35,7 @@ class XML_API TreeWalker
/// the view of the document defined by their whatToShow flags and filter (if
/// any). 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
@@ -50,22 +50,22 @@ class XML_API TreeWalker
/// Unlike most other DOM classes, TreeWalker supports value semantics.
///
/// If the TreeWalker's current node is removed from the document, the
/// result of calling any of the movement methods is undefined. This behavior
/// result of calling any of the movement methods is undefined. This behavior
/// does not conform to the DOM Level 2 Traversal specification.
{
public:
TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0);
/// Creates a TreeWalker over the subtree rooted at the specified node.
TreeWalker(const TreeWalker& walker);
/// Creates a TreeWalker by copying another TreeWalker.
TreeWalker& operator = (const TreeWalker& walker);
/// Assignment operator.
~TreeWalker();
/// Destroys the TreeWalker.
Node* root() const;
/// The root node of the TreeWalker, as specified when it was created.
@@ -86,7 +86,7 @@ public:
/// and the filter. Also note that this is currently the only situation where
/// NodeIterators may reject a complete subtree rather than skipping individual
/// nodes.
///
///
/// 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 expandEntityReferences to true
@@ -109,7 +109,7 @@ public:
Node* getCurrentNode() const;
/// See currentNode().
void setCurrentNode(Node* pNode);
/// Sets the current node.
@@ -158,7 +158,7 @@ protected:
private:
TreeWalker();
Node* _pRoot;
unsigned long _whatToShow;
NodeFilter* _pFilter;

View File

@@ -29,24 +29,24 @@ namespace XML {
class XML_API Attributes
/// Interface for a list of XML attributes.
/// This interface allows access to a list of attributes in three different ways:
/// 1.by attribute index;
/// 2.by Namespace-qualified name; or
/// 3.by qualified (prefixed) name.
///
/// The list will not contain attributes that were declared #IMPLIED but not
/// 1.by attribute index;
/// 2.by Namespace-qualified name; or
/// 3.by qualified (prefixed) name.
///
/// The list will not contain attributes that were declared #IMPLIED but not
/// specified in the start tag. It will also not contain
/// attributes used as Namespace declarations (xmlns*) unless the
/// attributes used as Namespace declarations (xmlns*) unless the
/// http://xml.org/sax/features/namespace-prefixes
/// feature is set to true (it is false by default).
///
/// If the namespace-prefixes feature (see above) is false, access by
///
/// If the namespace-prefixes feature (see above) is false, access by
/// qualified name may not be available; if the
/// http://xml.org/sax/features/namespaces feature is false, access by
/// http://xml.org/sax/features/namespaces feature is false, access by
/// Namespace-qualified names may not be available.
/// This interface replaces the now-deprecated SAX1 AttributeList interface,
/// This interface replaces the now-deprecated SAX1 AttributeList interface,
/// which does not contain Namespace support. In
/// addition to Namespace support, it adds the getIndex methods (below).
/// The order of attributes in the list is unspecified, and will vary from
/// The order of attributes in the list is unspecified, and will vary from
/// implementation to implementation.
{
public:
@@ -60,7 +60,7 @@ public:
/// Return the number of attributes in the list.
///
/// Once you know the number of attributes, you can iterate through the list.
virtual const XMLString& getLocalName(int i) const = 0;
/// Look up a local attribute name by index.
@@ -70,14 +70,14 @@ public:
virtual const XMLString& getType(int i) const = 0;
/// Look up an attribute type by index.
///
/// The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN",
/// The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN",
/// "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).
///
/// If the parser has not read a declaration for the attribute, or if the parser does not
/// report attribute types, then it must return the value "CDATA" as stated in the XML 1.0
/// If the parser has not read a declaration for the attribute, or if the parser does not
/// report attribute types, then it must return the value "CDATA" as stated in the XML 1.0
/// Recommendation (clause 3.3.3, "Attribute-Value Normalization").
///
/// For an enumerated attribute that is not a notation, the parser will report the type
///
/// For an enumerated attribute that is not a notation, the parser will report the type
/// as "NMTOKEN".
virtual const XMLString& getType(const XMLString& qname) const = 0;
@@ -93,7 +93,7 @@ public:
virtual const XMLString& getValue(int i) const = 0;
/// Look up an attribute value by index.
///
/// If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens
/// If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens
/// will be concatenated into a single string with each token separated by a single space.
virtual const XMLString& getValue(const XMLString& qname) const = 0;

View File

@@ -28,9 +28,9 @@ namespace XML {
class XML_API AttributesImpl: public Attributes
/// This class provides a default implementation of the SAX2 Attributes interface,
/// This class provides a default implementation of the SAX2 Attributes interface,
/// with the addition of manipulators so that the list can be modified or reused.
///
///
/// There are two typical uses of this class:
/// 1. to take a persistent snapshot of an Attributes object in a startElement event; or
/// 2. to construct or modify an Attributes object in a SAX2 driver or filter.
@@ -50,7 +50,7 @@ public:
AttributesImpl();
/// Creates the AttributesImpl.
AttributesImpl(const Attributes& attributes);
/// Creates the AttributesImpl by copying another one.
@@ -134,7 +134,7 @@ public:
void clear();
/// Removes all attributes.
void reserve(std::size_t capacity);
/// Reserves capacity in the internal vector.
@@ -152,11 +152,11 @@ public:
iterator begin() const;
/// Iterator support.
iterator end() const;
/// Iterator support.
protected:
protected:
Attribute* find(const XMLString& qname) const;
Attribute* find(const XMLString& namespaceURI, const XMLString& localName) const;

View File

@@ -31,20 +31,20 @@ class Attributes;
class XML_API ContentHandler
/// Receive notification of the logical content of a document.
/// Receive notification of the logical content of a document.
///
/// This is the main interface that most SAX applications implement: if the
/// application needs to be informed of basic parsing events, it implements
/// this interface and registers an instance with the SAX parser using the setContentHandler
/// method. The parser uses the instance to report basic document-related events
/// like the start and end of elements and character data.
///
///
/// The order of events in this interface is very important, and mirrors the
/// order of information in the document itself. For example, all of an element's
/// content (character data, processing instructions, and/or subelements) will
/// appear, in order, between the startElement event and the corresponding endElement
/// event.
///
///
/// This interface is similar to the now-deprecated SAX 1.0 DocumentHandler
/// interface, but it adds support for Namespaces and for reporting skipped
/// entities (in non-validating XML processors).
@@ -53,19 +53,19 @@ class XML_API ContentHandler
public:
virtual void setDocumentLocator(const Locator* loc) = 0;
/// Receive an object for locating the origin of SAX document events.
///
///
/// SAX parsers are strongly encouraged (though not absolutely required) to
/// supply a locator: if it does so, it must supply the locator to the application
/// by invoking this method before invoking any of the other methods in the
/// ContentHandler interface.
///
///
/// The locator allows the application to determine the end position of any
/// document-related event, even if the parser is not reporting an error. Typically,
/// the application will use this information for reporting its own errors (such
/// as character content that does not match an application's business rules).
/// The information returned by the locator is probably not sufficient for use
/// with a search engine.
///
///
/// Note that the locator will return correct information only during the invocation
/// SAX event callbacks after startDocument returns and before endDocument is
/// called. The application should not attempt to use it at any other time.
@@ -73,7 +73,7 @@ public:
virtual void startDocument() = 0;
/// Receive notification of the beginning of a document.
///
/// The SAX parser calls this function one time before calling all other
/// The SAX parser calls this function one time before calling all other
/// functions of this class (except SetDocumentLocator).
virtual void endDocument() = 0;
@@ -86,18 +86,18 @@ public:
virtual void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attrList) = 0;
/// Receive notification of the beginning of an element.
///
///
/// The Parser will invoke this method at the beginning of every element in
/// the XML document; there will be a corresponding endElement event for every
/// startElement event (even when the element is empty). All of the element's
/// content will be reported, in order, before the corresponding endElement
/// event.
///
///
/// This event allows up to three name components for each element:
/// 1. the Namespace URI;
/// 2. the local name; and
/// 3. the qualified (prefixed) name.
///
///
/// Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces
/// and the http://xml.org/sax/features/namespace-prefixes properties:
/// * the Namespace URI and local name are required when the namespaces
@@ -106,38 +106,38 @@ public:
/// * the qualified name is required when the namespace-prefixes property
/// is true, and is optional when the namespace-prefixes property is false (the
/// default).
///
///
/// Note that the attribute list provided will contain only attributes with
/// explicit values (specified or defaulted): #IMPLIED attributes will be omitted.
/// The attribute list will contain attributes used for Namespace declarations
/// (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes
/// property is true (it is false by default, and support for a true value is
/// optional).
///
///
/// Like characters(), attribute values may have characters that need more than
/// one char value.
virtual void endElement(const XMLString& uri, const XMLString& localName, const XMLString& qname) = 0;
/// Receive notification of the end of an element.
///
///
/// The SAX parser will invoke this method at the end of every element in the
/// XML document; there will be a corresponding startElement event for every
/// endElement event (even when the element is empty).
///
///
/// For information on the names, see startElement.
virtual void characters(const XMLChar ch[], int start, int length) = 0;
/// Receive notification of character data.
///
///
/// The Parser will call this method to report each chunk of character data.
/// SAX parsers may return all contiguous character data in a single chunk,
/// or they may split it into several chunks; however, all of the characters
/// in any single event must come from the same external entity so that the
/// Locator provides useful information.
///
///
/// The application must not attempt to read from the array outside of the specified
/// range.
///
///
/// Individual characters may consist of more than one XMLChar value. There
/// are three important cases where this happens, because characters can't be
/// represented in just sixteen bits. In one case, characters are represented
@@ -146,72 +146,72 @@ public:
/// case involves composite characters, such as a base character combining with
/// one or more accent characters. And most important, if XMLChar is a plain
/// char, characters are encoded in UTF-8.
///
///
/// Your code should not assume that algorithms using char-at-a-time idioms
/// will be working in character units; in some cases they will split characters.
/// This is relevant wherever XML permits arbitrary characters, such as attribute
/// values, processing instruction data, and comments as well as in data reported
/// from this method. It's also generally relevant whenever C++ code manipulates
/// internationalized text; the issue isn't unique to XML.
///
///
/// Note that some parsers will report whitespace in element content using the
/// ignorableWhitespace method rather than this one (validating parsers must
/// do so).
virtual void ignorableWhitespace(const XMLChar ch[], int start, int length) = 0;
/// Receive notification of ignorable whitespace in element content.
///
///
/// Validating Parsers must use this method to report each chunk of whitespace
/// in element content (see the W3C XML 1.0 recommendation, section 2.10): non-validating
/// parsers may also use this method if they are capable of parsing and using
/// content models.
///
///
/// SAX parsers may return all contiguous whitespace in a single chunk, or they
/// may split it into several chunks; however, all of the characters in any
/// single event must come from the same external entity, so that the Locator
/// provides useful information.
///
///
/// The application must not attempt to read from the array outside of the specified
/// range.
virtual void processingInstruction(const XMLString& target, const XMLString& data) = 0;
/// Receive notification of a processing instruction.
///
///
/// The Parser will invoke this method once for each processing instruction
/// found: note that processing instructions may occur before or after the main
/// document element.
///
///
/// A SAX parser must never report an XML declaration (XML 1.0, section 2.8)
/// or a text declaration (XML 1.0, section 4.3.1) using this method.
///
///
/// Like characters(), processing instruction data may have characters that
/// need more than one char value.
virtual void startPrefixMapping(const XMLString& prefix, const XMLString& uri) = 0;
/// Begin the scope of a prefix-URI Namespace mapping.
///
///
/// The information from this event is not necessary for normal Namespace processing:
/// the SAX XML reader will automatically replace prefixes for element and attribute
/// names when the http://xml.org/sax/features/namespaces feature is true (the
/// default).
///
///
/// There are cases, however, when applications need to use prefixes in character
/// data or in attribute values, where they cannot safely be expanded automatically;
/// the start/endPrefixMapping event supplies the information to the application
/// to expand prefixes in those contexts itself, if necessary.
///
///
/// Note that start/endPrefixMapping events are not guaranteed to be properly
/// nested relative to each other: all startPrefixMapping events will occur
/// immediately before the corresponding startElement event, and all endPrefixMapping
/// events will occur immediately after the corresponding endElement event,
/// but their order is not otherwise guaranteed.
///
///
/// There should never be start/endPrefixMapping events for the "xml" prefix,
/// since it is predeclared and immutable.
virtual void endPrefixMapping(const XMLString& prefix) = 0;
/// End the scope of a prefix-URI mapping.
///
///
/// See startPrefixMapping for details. These events will always occur immediately
/// after the corresponding endElement event, but the order of endPrefixMapping
/// events is not otherwise guaranteed.
@@ -222,7 +222,7 @@ public:
/// declarations. (The XML recommendation requires reporting skipped external
/// entities. SAX also reports internal entity expansion/non-expansion, except
/// within markup constructs.)
///
///
/// The Parser will invoke this method each time the entity is skipped. Non-validating
/// processors may skip entities if they have not seen the declarations (because,
/// for example, the entity was declared in an external DTD subset). All processors

View File

@@ -27,52 +27,52 @@ namespace XML {
class XML_API DTDHandler
/// If a SAX application needs information about notations and unparsed entities,
/// then the application implements this interface and registers an instance with the
/// SAX parser using the parser's setDTDHandler method. The parser uses the instance
/// If a SAX application needs information about notations and unparsed entities,
/// then the application implements this interface and registers an instance with the
/// SAX parser using the parser's setDTDHandler method. The parser uses the instance
/// to report notation and unparsed entity declarations to the application.
///
/// Note that this interface includes only those DTD events that the XML recommendation
/// Note that this interface includes only those DTD events that the XML recommendation
/// requires processors to report: notation and unparsed entity declarations.
///
/// The SAX parser may report these events in any order, regardless of the order in
/// which the notations and unparsed entities were declared; however, all DTD events
/// must be reported after the document handler's startDocument event, and before the first
/// The SAX parser may report these events in any order, regardless of the order in
/// which the notations and unparsed entities were declared; however, all DTD events
/// must be reported after the document handler's startDocument event, and before the first
/// startElement event. (If the LexicalHandler is used, these events must also be reported before the endDTD event.)
///
/// It is up to the application to store the information for future use (perhaps in a hash table or
/// object tree). If the application encounters attributes of type "NOTATION", "ENTITY", or "ENTITIES",
///
/// It is up to the application to store the information for future use (perhaps in a hash table or
/// object tree). If the application encounters attributes of type "NOTATION", "ENTITY", or "ENTITIES",
/// it can use the information that it obtained through this interface to find the entity and/or notation
/// corresponding with the attribute value.
{
public:
virtual void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId) = 0;
/// Receive notification of a notation declaration event.
///
/// It is up to the application to record the notation for later reference,
/// if necessary; notations may appear as attribute values and in unparsed
/// entity declarations, and are sometime used with processing instruction
///
/// It is up to the application to record the notation for later reference,
/// if necessary; notations may appear as attribute values and in unparsed
/// entity declarations, and are sometime used with processing instruction
/// target names.
///
/// At least one of publicId and systemId must be non-null. If a system identifier
/// is present, and it is a URL, the SAX parser must resolve it fully before passing
///
/// At least one of publicId and systemId must be non-null. If a system identifier
/// is present, and it is a URL, the SAX parser must resolve it fully before passing
/// it to the application through this event.
///
/// There is no guarantee that the notation declaration will be reported before any
///
/// There is no guarantee that the notation declaration will be reported before any
/// unparsed entities that use it.
///
/// Note that publicId and systemId maybe null, therefore we pass a pointer rather than a reference.
virtual void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName) = 0;
/// Receive notification of an unparsed entity declaration event.
///
/// Note that the notation name corresponds to a notation reported by the
/// notationDecl event. It is up to the application to record the entity for
///
/// Note that the notation name corresponds to a notation reported by the
/// notationDecl event. It is up to the application to record the entity for
/// later reference, if necessary; unparsed entities may appear as attribute values.
///
/// If the system identifier is a URL, the parser must resolve it fully before
///
/// If the system identifier is a URL, the parser must resolve it fully before
/// passing it to the application.
///
///
/// Note that publicId maybe null, therefore we pass a pointer rather than a reference.
protected:

View File

@@ -27,57 +27,57 @@ namespace XML {
class XML_API DeclHandler
/// This is an optional extension handler for SAX2 to provide information
/// This is an optional extension handler for SAX2 to provide information
/// about DTD declarations in an XML document. XML
/// readers are not required to support this handler, and this handler is
/// readers are not required to support this handler, and this handler is
/// not included in the core SAX2 distribution.
///
/// Note that data-related DTD declarations (unparsed entities and notations)
/// Note that data-related DTD declarations (unparsed entities and notations)
/// are already reported through the DTDHandler interface.
/// If you are using the declaration handler together with a lexical handler,
/// If you are using the declaration handler together with a lexical handler,
/// all of the events will occur between the startDTD and the endDTD events.
/// To set the DeclHandler for an XML reader, use the setProperty method
/// with the propertyId "http://xml.org/sax/properties/declaration-handler".
/// To set the DeclHandler for an XML reader, use the setProperty method
/// with the propertyId "http://xml.org/sax/properties/declaration-handler".
/// If the reader does not support declaration events, it will throw a
/// SAXNotRecognizedException or a SAXNotSupportedException when you attempt to
/// SAXNotRecognizedException or a SAXNotSupportedException when you attempt to
/// register the handler.
{
public:
virtual void attributeDecl(const XMLString& eName, const XMLString& aName, const XMLString* valueDefault, const XMLString* value) = 0;
/// Report an attribute type declaration.
///
/// Only the effective (first) declaration for an attribute will be reported.
/// The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS",
/// "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group
/// with the separator "|" and all whitespace removed, or the word "NOTATION"
/// followed by a space followed by a parenthesized token group with all whitespace
///
/// Only the effective (first) declaration for an attribute will be reported.
/// The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS",
/// "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group
/// with the separator "|" and all whitespace removed, or the word "NOTATION"
/// followed by a space followed by a parenthesized token group with all whitespace
/// removed.
///
/// The value will be the value as reported to applications, appropriately normalized
/// and with entity and character references expanded.
/// The value will be the value as reported to applications, appropriately normalized
/// and with entity and character references expanded.
virtual void elementDecl(const XMLString& name, const XMLString& model) = 0;
/// Report an element type declaration.
///
/// The content model will consist of the string "EMPTY", the string "ANY", or a
/// parenthesised group, optionally followed by an occurrence indicator. The model
/// will be normalized so that all parameter entities are fully resolved and all
/// whitespace is removed,and will include the enclosing parentheses. Other
/// normalization (such as removing redundant parentheses or simplifying occurrence
/// The content model will consist of the string "EMPTY", the string "ANY", or a
/// parenthesised group, optionally followed by an occurrence indicator. The model
/// will be normalized so that all parameter entities are fully resolved and all
/// whitespace is removed,and will include the enclosing parentheses. Other
/// normalization (such as removing redundant parentheses or simplifying occurrence
/// indicators) is at the discretion of the parser.
virtual void externalEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId) = 0;
/// Report an external entity declaration.
///
///
/// Only the effective (first) declaration for each entity will be reported.
///
/// If the system identifier is a URL, the parser must resolve it fully before
///
/// If the system identifier is a URL, the parser must resolve it fully before
/// passing it to the application.
virtual void internalEntityDecl(const XMLString& name, const XMLString& value) = 0;
/// Report an internal entity declaration.
///
/// Only the effective (first) declaration for each entity will be reported. All
/// Only the effective (first) declaration for each entity will be reported. All
/// parameter entities in the value will be expanded, but general entities will not.
protected:

View File

@@ -30,29 +30,29 @@ namespace XML {
class XML_API DefaultHandler: public EntityResolver, public DTDHandler, public ContentHandler, public ErrorHandler
/// Default base class for SAX2 event handlers.
/// This class is available as a convenience base class for SAX2 applications:
/// Default base class for SAX2 event handlers.
/// This class is available as a convenience base class for SAX2 applications:
/// it provides default implementations for all of the
/// callbacks in the four core SAX2 handler classes:
/// * EntityResolver
/// * DTDHandler
/// * ContentHandler
/// * ErrorHandler
/// Application writers can extend this class when they need to implement only
/// * EntityResolver
/// * DTDHandler
/// * ContentHandler
/// * ErrorHandler
/// Application writers can extend this class when they need to implement only
/// part of an interface; parser writers can instantiate this
/// class to provide default handlers when the application has not supplied its own.
{
public:
DefaultHandler();
/// Creates the DefaultHandler.
~DefaultHandler();
/// Destroys the DefaultHandler.
// EntityResolver
InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
void releaseInputSource(InputSource* pSource);
// DTDHandler
void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
@@ -69,7 +69,7 @@ public:
void startPrefixMapping(const XMLString& prefix, const XMLString& uri);
void endPrefixMapping(const XMLString& prefix);
void skippedEntity(const XMLString& name);
// ErrorHandler
void warning(const SAXException& exc);
void error(const SAXException& exc);

View File

@@ -30,44 +30,44 @@ class InputSource;
class XML_API EntityResolver
/// If a SAX application needs to implement customized handling for external entities,
/// it must implement this interface and register an instance with the SAX driver using
/// If a SAX application needs to implement customized handling for external entities,
/// it must implement this interface and register an instance with the SAX driver using
/// the setEntityResolver method.
///
/// The XML reader will then allow the application to intercept any external entities
/// (including the external DTD subset and external parameter entities, if any) before
///
/// The XML reader will then allow the application to intercept any external entities
/// (including the external DTD subset and external parameter entities, if any) before
/// including them.
///
/// Many SAX applications will not need to implement this interface, but it will be
/// especially useful for applications that build XML documents from databases or other
///
/// Many SAX applications will not need to implement this interface, but it will be
/// especially useful for applications that build XML documents from databases or other
/// specialised input sources, or for applications that use URI types other than URLs.
///
/// The application can also use this interface to redirect system identifiers to local
/// The application can also use this interface to redirect system identifiers to local
/// URIs or to look up replacements in a catalog (possibly by using the public identifier).
{
public:
virtual InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId) = 0;
/// Allow the application to resolve external entities.
///
/// The parser will call this method before opening any external entity except the
/// top-level document entity. Such entities include the external DTD subset and
/// external parameter entities referenced within the DTD (in either case, only
/// if the parser reads external parameter entities), and external general entities
/// referenced within the document element (if the parser reads external general entities).
/// The application may request that the parser locate the entity itself, that it use an
/// alternative URI, or that it use data provided by the application (as a character or
///
/// The parser will call this method before opening any external entity except the
/// top-level document entity. Such entities include the external DTD subset and
/// external parameter entities referenced within the DTD (in either case, only
/// if the parser reads external parameter entities), and external general entities
/// referenced within the document element (if the parser reads external general entities).
/// The application may request that the parser locate the entity itself, that it use an
/// alternative URI, or that it use data provided by the application (as a character or
/// byte input stream).
///
/// Application writers can use this method to redirect external system identifiers to
/// secure and/or local URIs, 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).
/// Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve
/// resources. However, SAX specifies how to interpret any InputSource returned by this method,
///
/// Application writers can use this method to redirect external system identifiers to
/// secure and/or local URIs, 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).
/// Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve
/// resources. However, SAX specifies how to interpret any InputSource returned by this method,
/// and that if none is returned, then the system ID will be dereferenced as a URL.
///
/// If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to
///
/// If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to
/// the application.
///
///
/// Note that publicId maybe null, therefore we pass a pointer rather than a reference.
virtual void releaseInputSource(InputSource* pSource) = 0;

View File

@@ -43,31 +43,31 @@ public:
EntityResolverImpl();
/// Creates an EntityResolverImpl that uses the default
/// URIStreamOpener.
EntityResolverImpl(const Poco::URIStreamOpener& opener);
/// Creates an EntityResolverImpl that uses the given
/// URIStreamOpener.
~EntityResolverImpl();
/// Destroys the EntityResolverImpl.
InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
/// Tries to use the URIStreamOpener to create and open an istream
/// for the given systemId, which is interpreted as an URI.
///
/// If the systemId is not a valid URI, it is interpreted as
/// a local filesystem path and a Poco::FileInputStream is opened for it.
void releaseInputSource(InputSource* pSource);
/// Deletes the InputSource's stream.
protected:
std::istream* resolveSystemId(const XMLString& systemId);
std::istream* resolveSystemId(const XMLString& systemId);
private:
EntityResolverImpl(const EntityResolverImpl&);
EntityResolverImpl& operator = (const EntityResolverImpl&);
const Poco::URIStreamOpener& _opener;
};

View File

@@ -29,56 +29,56 @@ class SAXException;
class XML_API ErrorHandler
/// If a SAX application needs to implement customized error handling, it must
/// implement this interface and then register an instance with the XML reader
/// using the setErrorHandler method. The parser will then report all errors and
/// If a SAX application needs to implement customized error handling, it must
/// implement this interface and then register an instance with the XML reader
/// using the setErrorHandler method. The parser will then report all errors and
/// warnings through this interface.
///
/// WARNING: If an application does not register an ErrorHandler, XML parsing errors
/// will go unreported, except that SAXParseExceptions will be thrown for fatal errors.
/// In order to detect validity errors, an ErrorHandler that does something with error()
///
/// WARNING: If an application does not register an ErrorHandler, XML parsing errors
/// will go unreported, except that SAXParseExceptions will be thrown for fatal errors.
/// In order to detect validity errors, an ErrorHandler that does something with error()
/// calls must be registered.
///
/// For XML processing errors, a SAX driver must use this interface in preference to
/// throwing an exception: it is up to the application to decide whether to throw an
/// exception for different types of errors and warnings. Note, however, that there is no
/// requirement that the parser continue to report additional errors after a call to
/// fatalError. In other words, a SAX driver class may throw an exception after reporting
/// any fatalError. Also parsers may throw appropriate exceptions for non-XML errors. For
/// example, XMLReader::parse() would throw an IOException for errors accessing entities or
///
/// For XML processing errors, a SAX driver must use this interface in preference to
/// throwing an exception: it is up to the application to decide whether to throw an
/// exception for different types of errors and warnings. Note, however, that there is no
/// requirement that the parser continue to report additional errors after a call to
/// fatalError. In other words, a SAX driver class may throw an exception after reporting
/// any fatalError. Also parsers may throw appropriate exceptions for non-XML errors. For
/// example, XMLReader::parse() would throw an IOException for errors accessing entities or
/// the document.
{
public:
virtual void warning(const SAXException& exc) = 0;
/// Receive notification of a warning.
///
/// SAX parsers will use this method to report conditions that are not errors or fatal
///
/// SAX parsers will use this method to report conditions that are not errors or fatal
/// errors as defined by the XML recommendation. The default behaviour is to take no action.
///
/// The SAX parser must continue to provide normal parsing events after invoking this method:
///
/// The SAX parser must continue to provide normal parsing events after invoking this method:
/// it should still be possible for the application to process the document through to the end.
///
///
/// Filters may use this method to report other, non-XML warnings as well.
virtual void error(const SAXException& exc) = 0;
/// Receive notification of a recoverable error.
///
/// This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0
/// Recommendation. For example, a validating parser would use this callback to report
///
/// This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0
/// Recommendation. For example, a validating parser would use this callback to report
/// the violation of a validity constraint. The default behaviour is to take no action.
///
/// The SAX parser must continue to provide normal parsing events after invoking this
/// method: it should still be possible for the application to process the document through
/// to the end. If the application cannot do so, then the parser should report a fatal error
///
/// The SAX parser must continue to provide normal parsing events after invoking this
/// method: it should still be possible for the application to process the document through
/// to the end. If the application cannot do so, then the parser should report a fatal error
/// even if the XML recommendation does not require it to do so.
///
///
/// Filters may use this method to report other, non-XML errors as well.
virtual void fatalError(const SAXException& exc) = 0;
/// Receive notification of a non-recoverable error.
/// The application must assume that the document is unusable after the parser has
/// invoked this method, and should continue (if at all) only for the sake of collecting
/// additional error messages: in fact, SAX parsers are free to stop reporting any other
/// The application must assume that the document is unusable after the parser has
/// invoked this method, and should continue (if at all) only for the sake of collecting
/// additional error messages: in fact, SAX parsers are free to stop reporting any other
/// events once this method has been invoked.
protected:

View File

@@ -28,46 +28,46 @@ namespace XML {
class XML_API InputSource
/// This class allows a SAX 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
/// This class allows a SAX 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.
///
/// There are two places that the application can deliver an input source to the
/// parser: as the argument to the Parser.parse method, or as the return value of the
///
/// There are two places that the application can deliver an input source to the
/// parser: as the argument to the Parser.parse method, or as the return value of the
/// EntityResolver::resolveEntity() method.
///
/// The SAX parser will use the InputSource object to determine how to read XML input.
/// If there is a character stream available, the parser will read that stream directly,
/// disregarding any text encoding declaration found in that stream. If there is no character
/// stream, but there is a byte stream, the parser will use that byte stream, using the
/// encoding specified in the InputSource or else (if no encoding is specified) autodetecting
/// the character encoding using an algorithm such as the one in the XML specification.
/// If neither a character stream nor a byte stream is available, the parser will attempt
///
/// The SAX parser will use the InputSource object to determine how to read XML input.
/// If there is a character stream available, the parser will read that stream directly,
/// disregarding any text encoding declaration found in that stream. If there is no character
/// stream, but there is a byte stream, the parser will use that byte stream, using the
/// encoding specified in the InputSource or else (if no encoding is specified) autodetecting
/// the character encoding using an algorithm such as the one in the XML specification.
/// 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.
///
/// An InputSource object belongs to the application: the SAX parser shall never modify it in
/// any way (it may modify a copy if necessary). However, standard processing of both byte and
/// character streams is to close them on as part of end-of-parse cleanup, so applications should
///
/// An InputSource object belongs to the application: the SAX parser shall never modify it in
/// any way (it may modify a copy if necessary). However, standard processing of both byte and
/// character streams is to close them on as part of end-of-parse cleanup, so applications should
/// not attempt to re-use such streams after they have been handed to a parser.
{
public:
InputSource();
/// Zero-argument default constructor.
InputSource(const XMLString& systemId);
/// Creates a new input source with a system identifier.
/// Applications may use setPublicId to include a public identifier as well,
/// Applications may use setPublicId to include a public identifier as well,
/// or setEncoding to specify the character encoding, if known.
///
/// If the system identifier is a URL, it must be fully resolved (it may not
///
/// If the system identifier is a URL, it must be fully resolved (it may not
/// be a relative URL).
InputSource(XMLByteInputStream& istr);
/// Creates a new input source with a byte stream.
///
///
/// Application writers should use setSystemId() to provide a base for resolving
/// relative URIs, may use setPublicId to include a public identifier, and may use
/// relative URIs, may use setPublicId to include a public identifier, and may use
/// setEncoding to specify the object's character encoding.
~InputSource();
@@ -76,34 +76,34 @@ public:
void setPublicId(const XMLString& publicId);
/// Set the public identifier for this input source.
///
/// The public identifier is always optional: if the application writer includes one,
/// The public identifier is always optional: if the application writer includes one,
/// it will be provided as part of the location information.
void setSystemId(const XMLString& systemId);
/// Set the system identifier for this input source.
///
/// The system identifier is optional if there is a byte stream or a character stream,
/// but it is still useful to provide one, since the application can use it to resolve
/// relative URIs and can include it in error messages and warnings (the parser will
/// attempt to open a connection to the URI only if there is no byte stream or character
/// The system identifier is optional if there is a byte stream or a character stream,
/// but it is still useful to provide one, since the application can use it to resolve
/// relative URIs and can include it in error messages and warnings (the parser will
/// attempt to open a connection to the URI only if there is no byte stream or character
/// stream specified).
///
/// If the application knows the character encoding of the object pointed to by the system
///
/// If the application knows the character encoding of the object pointed to by the system
/// identifier, it can register the encoding using the setEncoding method.
///
///
/// If the system identifier is a URL, it must be fully resolved (it may not be a relative URL).
const XMLString& getPublicId() const;
/// Get the public identifier for this input source.
const XMLString& getSystemId() const;
/// Get the system identifier for this input source.
void setByteStream(XMLByteInputStream& istr);
/// Set the byte stream for this input source.
/// The SAX parser will ignore this if there is also a character stream specified, but it
/// The SAX parser will ignore this if there is also a character stream specified, but it
/// will use a byte stream in preference to opening a URI connection itself.
XMLByteInputStream* getByteStream() const;
/// Get the byte stream for this input source.
@@ -115,9 +115,9 @@ public:
void setEncoding(const XMLString& encoding);
/// Set the character encoding, if known.
/// The encoding must be a string acceptable for an XML encoding declaration
/// The encoding must be a string acceptable for an XML encoding declaration
/// (see section 4.3.3 of the XML 1.0 recommendation).
const XMLString& getEncoding() const;
/// Get the character encoding for a byte stream or URI.

View File

@@ -27,91 +27,91 @@ namespace XML {
class XML_API LexicalHandler
/// This is an optional extension handler for SAX2 to provide lexical information
/// about an XML document, such as comments and CDATA section boundaries.
/// XML readers are not required to recognize this handler, and it is not part of
/// This is an optional extension handler for SAX2 to provide lexical information
/// about an XML document, such as comments and CDATA section boundaries.
/// XML readers are not required to recognize this handler, and it is not part of
/// core-only SAX2 distributions.
///
/// The events in the lexical handler apply to the entire document, not just to the
/// document element, and all lexical handler events must appear between the content
///
/// The events in the lexical handler apply to the entire document, not just to the
/// document element, and all lexical handler events must appear between the content
/// handler's startDocument and endDocument events.
///
/// To set the LexicalHandler for an XML reader, use the setProperty method with the
/// property name http://xml.org/sax/properties/lexical-handler and an object implementing
/// this interface (or null) as the value. If the reader does not report lexical events,
///
/// To set the LexicalHandler for an XML reader, use the setProperty method with the
/// property name http://xml.org/sax/properties/lexical-handler and an object implementing
/// this interface (or null) as the value. If the reader does not report lexical events,
/// it will throw a SAXNotRecognizedException when you attempt to register the handler.
{
public:
virtual void startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId) = 0;
/// Report the start of DTD declarations, if any.
///
/// This method is intended to report the beginning of the DOCTYPE declaration;
///
/// This method is intended to report the beginning of the DOCTYPE declaration;
/// if the document has no DOCTYPE declaration, this method will not be invoked.
///
/// All declarations reported through DTDHandler or DeclHandler events must appear
/// between the startDTD and endDTD events. Declarations are assumed to belong to
/// the internal DTD subset unless they appear between startEntity and endEntity
/// events. Comments and processing instructions from the DTD should also be reported
/// between the startDTD and endDTD events, in their original order of (logical) occurrence;
/// they are not required to appear in their correct locations relative to DTDHandler or
///
/// All declarations reported through DTDHandler or DeclHandler events must appear
/// between the startDTD and endDTD events. Declarations are assumed to belong to
/// the internal DTD subset unless they appear between startEntity and endEntity
/// events. Comments and processing instructions from the DTD should also be reported
/// between the startDTD and endDTD events, in their original order of (logical) occurrence;
/// they are not required to appear in their correct locations relative to DTDHandler or
/// DeclHandler events, however.
///
/// Note that the start/endDTD events will appear within the start/endDocument events from
///
/// Note that the start/endDTD events will appear within the start/endDocument events from
/// ContentHandler and before the first startElement event.
virtual void endDTD() = 0;
/// Report the end of DTD declarations.
///
/// This method is intended to report the end of the DOCTYPE declaration; if the document
///
/// This method is intended to report the end of the DOCTYPE declaration; if the document
/// has no DOCTYPE declaration, this method will not be invoked.
virtual void startEntity(const XMLString& name) = 0;
/// Report the beginning of some internal and external XML entities.
///
/// The reporting of parameter entities (including the external DTD subset) is optional,
/// and SAX2 drivers that report LexicalHandler events may not implement it; you can use the
/// http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control
///
/// The reporting of parameter entities (including the external DTD subset) is optional,
/// and SAX2 drivers that report LexicalHandler events may not implement it; you can use the
/// http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control
/// the reporting of parameter entities.
///
/// General entities are reported with their regular names, parameter entities have '%'
///
/// General entities are reported with their regular names, parameter entities have '%'
/// prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".
///
/// When a SAX2 driver is providing these events, all other events must be properly nested
/// within start/end entity events. There is no additional requirement that events from
///
/// When a SAX2 driver is providing these events, all other events must be properly nested
/// within start/end entity events. There is no additional requirement that events from
/// DeclHandler or DTDHandler be properly ordered.
///
/// Note that skipped entities will be reported through the skippedEntity event, which is part of
///
/// Note that skipped entities will be reported through the skippedEntity event, which is part of
/// the ContentHandler interface.
///
/// Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under
///
/// Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under
/// any circumstances:
///
///
/// * general entities within attribute values
/// * parameter entities within declarations
///
/// These will be silently expanded, with no indication of where the original entity boundaries were.
///
///
/// Note also that the boundaries of character references (which are not really entities anyway) are not reported.
///
/// All start/endEntity events must be properly nested.
///
/// All start/endEntity events must be properly nested.
virtual void endEntity(const XMLString& name) = 0;
/// Report the end of an entity.
virtual void startCDATA() = 0;
/// Report the start of a CDATA section.
///
/// The contents of the CDATA section will be reported through the regular characters event;
/// The contents of the CDATA section will be reported through the regular characters event;
/// this event is intended only to report the boundary.
virtual void endCDATA() = 0;
/// Report the end of a CDATA section.
virtual void comment(const XMLChar ch[], int start, int length) = 0;
/// Report an XML comment anywhere in the document.
///
/// This callback will be used for comments inside or outside the document element,
/// including comments in the external DTD subset (if read). Comments in the DTD must
///
/// This callback will be used for comments inside or outside the document element,
/// including comments in the external DTD subset (if read). Comments in the DTD must
/// be properly nested inside start/endDTD and start/endEntity events (if used).
protected:

View File

@@ -28,68 +28,68 @@ namespace XML {
class XML_API Locator
/// Interface for associating a SAX event with a document location.
///
/// If a SAX parser provides location information to the SAX application, it does so by
/// implementing this interface and then passing an instance to the application using the
/// content handler's setDocumentLocator method. The application can use the object to obtain
///
/// If a SAX parser provides location information to the SAX application, it does so by
/// implementing this interface and then passing an instance to the application using the
/// content handler's setDocumentLocator method. The application can use the object to obtain
/// the location of any other SAX event in the XML source document.
///
/// Note that the results returned by the object will be valid only during the scope of each
/// callback method: the application will receive unpredictable results if it attempts to use
///
/// Note that the results returned by the object will be valid only during the scope of each
/// callback method: the application will receive unpredictable results if it attempts to use
/// the locator at any other time, or after parsing completes.
///
/// SAX parsers are not required to supply a locator, but they are very strongly encouraged to
/// do so. If the parser supplies a locator, it must do so before reporting any other document
/// events. If no locator has been set by the time the application receives the startDocument event,
///
/// SAX parsers are not required to supply a locator, but they are very strongly encouraged to
/// do so. If the parser supplies a locator, it must do so before reporting any other document
/// events. If no locator has been set by the time the application receives the startDocument event,
/// the application should assume that a locator is not available.
{
public:
virtual XMLString getPublicId() const = 0;
/// Return the public identifier for the current document event.
///
/// The return value is the public identifier of the document entity or of the external
///
/// The return value is the public identifier of the document entity or of the external
/// parsed entity in which the markup triggering the event appears.
virtual XMLString getSystemId() const = 0;
/// Return the system identifier for the current document event.
///
/// The return value is the system identifier of the document entity or of the external
///
/// The return value is the system identifier of the document entity or of the external
/// parsed entity in which the markup triggering the event appears.
///
/// If the system identifier is a URL, the parser must resolve it fully before passing
/// it to the application. For example, a file name must always be provided as a
///
/// If the system identifier is a URL, the parser must resolve it fully before passing
/// it to the application. For example, a file name must always be provided as a
/// file:... URL, and other kinds of relative URI are also resolved against their bases.
virtual int getLineNumber() const = 0;
/// Return the line number where the current document event ends.
/// Lines are delimited by line ends, which are defined in the XML specification.
///
/// Warning: The return value from the method is intended only as an approximation for
/// the sake of diagnostics; it is not intended to provide sufficient information to
/// edit the character content of the original XML document. In some cases, these "line"
/// numbers match what would be displayed as columns, and in others they may not match the
///
/// Warning: The return value from the method is intended only as an approximation for
/// the sake of diagnostics; it is not intended to provide sufficient information to
/// edit the character content of the original XML document. In some cases, these "line"
/// numbers match what would be displayed as columns, and in others they may not match the
/// source text due to internal entity expansion.
///
/// The return value is an approximation of the line number in the document entity or external
///
/// The return value is an approximation of the line number in the document entity or external
/// parsed entity where the markup triggering the event appears.
///
/// If possible, the SAX driver should provide the line position of the first character after
///
/// If possible, the SAX driver should provide the line position of the first character after
/// the text associated with the document event. The first line is line 1.
virtual int getColumnNumber() const = 0;
/// Return the column number where the current document event ends.
/// Return the column number where the current document event ends.
/// This is one-based number of characters since the last line end.
///
/// Warning: The return value from the method is intended only as an approximation
/// for the sake of diagnostics; it is not intended to provide sufficient information
/// to edit the character content of the original XML document. For example, when lines
/// contain combining character sequences, wide characters, surrogate pairs, or bi-directional
///
/// Warning: The return value from the method is intended only as an approximation
/// for the sake of diagnostics; it is not intended to provide sufficient information
/// to edit the character content of the original XML document. For example, when lines
/// contain combining character sequences, wide characters, surrogate pairs, or bi-directional
/// text, the value may not correspond to the column in a text editor's display.
///
/// The return value is an approximation of the column number in the document entity or external
///
/// The return value is an approximation of the column number in the document entity or external
/// parsed entity where the markup triggering the event appears.
///
/// If possible, the SAX driver should provide the line position of the first character after
///
/// If possible, the SAX driver should provide the line position of the first character after
/// the text associated with the document event. The first column in each line is column 1.
protected:

View File

@@ -33,35 +33,35 @@ class XML_API LocatorImpl: public Locator
public:
LocatorImpl();
/// Zero-argument constructor.
///
/// This will not normally be useful, since the main purpose of this class is
///
/// This will not normally be useful, since the main purpose of this class is
/// to make a snapshot of an existing Locator.
LocatorImpl(const Locator& loc);
/// Copy constructor.
///
/// Create a persistent copy of the current state of a locator. When the original
/// locator changes, this copy will still keep the original values (and it can be
///
/// Create a persistent copy of the current state of a locator. When the original
/// locator changes, this copy will still keep the original values (and it can be
/// used outside the scope of DocumentHandler methods).
~LocatorImpl();
/// Destroys the Locator.
LocatorImpl& operator = (const Locator& loc);
/// Assignment operator.
XMLString getPublicId() const;
/// Return the saved public identifier.
XMLString getSystemId() const;
/// Return the saved system identifier.
int getLineNumber() const;
/// Return the saved line number (1-based).
int getColumnNumber() const;
/// Return the saved column number (1-based).
void setPublicId(const XMLString& publicId);
/// Set the public identifier for this locator.

View File

@@ -30,13 +30,13 @@ namespace XML {
class XML_API NamespaceSupport
/// Encapsulate Namespace logic for use by SAX drivers.
/// This class encapsulates the logic of Namespace processing:
/// Encapsulate Namespace logic for use by SAX drivers.
/// This class encapsulates the logic of Namespace processing:
/// it tracks the declarations currently in force for each context and
/// automatically processes qualified XML 1.0 names into their Namespace
/// automatically processes qualified XML 1.0 names into their Namespace
/// parts; it can also be used in reverse for generating
/// XML 1.0 from Namespaces.
/// Namespace support objects are reusable, but the reset method
/// Namespace support objects are reusable, but the reset method
/// must be invoked between each session.
{
public:
@@ -44,40 +44,40 @@ public:
NamespaceSupport();
/// Creates a NamespaceSupport object.
~NamespaceSupport();
/// Destroys a NamespaceSupport object.
bool declarePrefix(const XMLString& prefix, const XMLString& namespaceURI);
/// Declare a Namespace prefix. All prefixes must be declared before they are
/// referenced. For example, a SAX driver (parser) would scan an element's attributes
/// in two passes: first for namespace declarations, then a second pass using
/// processName() to interpret prefixes against (potentially redefined) prefixes.
///
///
/// This method declares a prefix in the current Namespace context; the prefix
/// will remain in force until this context is popped, unless it is shadowed
/// in a descendant context.
///
///
/// To declare the default element Namespace, use the empty string as the prefix.
///
///
/// Note that you must not declare a prefix after you've pushed and popped another
/// Namespace context, or treated the declarations phase as complete by processing
/// a prefixed name.
///
/// Returns true if the prefix was legal, false otherwise.
bool undeclarePrefix(const XMLString& prefix);
/// Remove the given namespace prefix.
void getDeclaredPrefixes(PrefixSet& prefixes) const;
/// Return an enumeration of all prefixes declared in this context.
///
///
/// The empty (default) prefix will be included in this enumeration; note that
/// this behaviour differs from that of getPrefix() and getPrefixes().
const XMLString& getPrefix(const XMLString& namespaceURI) const;
/// Return one of the prefixes mapped to a Namespace URI.
///
///
/// If more than one prefix is currently mapped to the same URI, this method
/// will make an arbitrary selection; if you want all of the prefixes, use the
/// getPrefixes() method instead.
@@ -90,7 +90,7 @@ public:
/// Return an enumeration of all prefixes whose declarations are active in the
/// current context. This includes declarations from parent contexts that have
/// not been overridden.
///
///
/// Note: if there is a default prefix, it will not be returned in this enumeration;
/// check for the default prefix using the getURI with an argument of "".
@@ -98,19 +98,19 @@ public:
/// Return an enumeration of all prefixes for a given URI whose declarations
/// are active in the current context. This includes declarations from parent
/// contexts that have not been overridden.
///
///
/// This method returns prefixes mapped to a specific Namespace URI. The xml:
/// prefix will be included. If you want only one prefix that's mapped to the
/// Namespace URI, and you don't care which one you get, use the getPrefix() method
/// instead.
///
///
/// Note: the empty (default) prefix is never included in this enumeration;
/// to check for the presence of a default Namespace, use the getURI() method
/// with an argument of "".
const XMLString& getURI(const XMLString& prefix) const;
/// Look up a prefix and get the currently-mapped Namespace URI.
///
///
/// This method looks up the prefix in the current context. Use the empty string
/// ("") for the default Namespace.
@@ -118,7 +118,7 @@ public:
/// Start a new Namespace context. The new context will automatically inherit
/// the declarations of its parent context, but it will also keep track of which
/// declarations were made within this context.
///
///
/// Event callback code should start a new context once per element. This means
/// being ready to call this in either of two places. For elements that don't
/// include namespace declarations, the ContentHandler::startElement() callback
@@ -126,9 +126,9 @@ public:
/// first ContentHandler::startPrefixMapping() callback. A boolean flag can be
/// used to track whether a context has been started yet. When either of those
/// methods is called, it checks the flag to see if a new context needs to be
/// started. If so, it starts the context and sets the flag. After
/// started. If so, it starts the context and sets the flag. After
/// ContentHandler::startElement() does that, it always clears the flag.
///
///
/// Normally, SAX drivers would push a new context at the beginning of each
/// XML element. Then they perform a first pass over the attributes to process
/// all namespace declarations, making ContentHandler::startPrefixMapping() callbacks.
@@ -136,36 +136,36 @@ public:
/// all attributes and for the element name. Finally all the information for
/// the ContentHandler::startElement() callback is available, so it can then
/// be made.
///
///
/// The Namespace support object always starts with a base context already in
/// force: in this context, only the "xml" prefix is declared.
void popContext();
/// Revert to the previous Namespace context.
///
///
/// Normally, you should pop the context at the end of each XML element. After
/// popping the context, all Namespace prefix mappings that were previously
/// in force are restored.
///
///
/// You must not attempt to declare additional Namespace prefixes after popping
/// a context, unless you push another context first.
bool processName(const XMLString& qname, XMLString& namespaceURI, XMLString& localName, bool isAttribute) const;
/// Process a raw XML 1.0 name.
/// This method processes a raw XML 1.0 name in the current context
/// Process a raw XML 1.0 name.
/// This method processes a raw XML 1.0 name in the current context
/// by removing the prefix and looking it up among the
/// prefixes currently declared. The result will be returned in
/// namespaceURI and localName.
/// If the raw name has a prefix that has not been declared, then the return
/// value will be false, otherwise true.
///
/// Note that attribute names are processed differently than element names:
/// Note that attribute names are processed differently than element names:
/// an unprefixed element name will receive the
/// default Namespace (if any), while an unprefixed attribute name will not.
void reset();
/// Reset this Namespace support object for reuse.
///
///
/// It is necessary to invoke this method before reusing the Namespace support
/// object for a new session. If namespace declaration URIs are to be supported,
/// that flag must also be set to a non-default value.
@@ -182,7 +182,7 @@ private:
typedef std::map<XMLString, XMLString> Context;
typedef std::vector<Context> ContextVec;
ContextVec _contexts;
static const XMLString EMPTY_STRING;

View File

@@ -30,31 +30,31 @@ namespace XML {
POCO_DECLARE_EXCEPTION(XML_API, SAXException, XMLException)
/// The base class for all SAX-related exceptions like SAXParseException,
/// SAXNotRecognizedException or SAXNotSupportedException.
///
/// This class can contain basic error or warning information from either the XML parser
/// or the application: a parser writer or application writer can subclass it to provide
/// additional functionality. SAX handlers may throw this exception or any exception subclassed
///
/// This class can contain basic error or warning information from either the XML parser
/// or the application: a parser writer or application writer can subclass it to provide
/// additional functionality. SAX handlers may throw this exception or any exception subclassed
/// from it.
///
/// If the application needs to pass through other types of exceptions, it must wrap those exceptions
///
/// If the application needs to pass through other types of exceptions, it must wrap those exceptions
/// in a SAXException or an exception derived from a SAXException.
///
/// If the parser or application needs to include information about a specific location in an XML
///
/// If the parser or application needs to include information about a specific location in an XML
/// document, it should use the SAXParseException subclass.
POCO_DECLARE_EXCEPTION(XML_API, SAXNotRecognizedException, SAXException)
/// Exception class for an unrecognized identifier.
///
/// An XMLReader will throw this exception when it finds an unrecognized feature or property
///
/// An XMLReader will throw this exception when it finds an unrecognized feature or property
/// identifier; SAX applications and extensions may use this class for other, similar purposes.
POCO_DECLARE_EXCEPTION(XML_API, SAXNotSupportedException, SAXException)
/// Exception class for an unsupported operation.
///
/// An XMLReader will throw this exception when it recognizes a feature or property identifier,
/// but cannot perform the requested operation (setting a state or value). Other SAX2 applications
///
/// An XMLReader will throw this exception when it recognizes a feature or property identifier,
/// but cannot perform the requested operation (setting a state or value). Other SAX2 applications
/// and extensions may use this class for similar purposes.
@@ -64,15 +64,15 @@ class Locator;
class XML_API SAXParseException: public SAXException
/// Encapsulate an XML parse error or warning.
///
/// This exception may include information for locating the error in the original XML document,
/// as if it came from a Locator object. Note that although the application will receive a
/// SAXParseException as the argument to the handlers in the ErrorHandler interface, the application
/// is not actually required to throw the exception; instead, it can simply read the information in it
/// This exception may include information for locating the error in the original XML document,
/// as if it came from a Locator object. Note that although the application will receive a
/// SAXParseException as the argument to the handlers in the ErrorHandler interface, the application
/// is not actually required to throw the exception; instead, it can simply read the information in it
/// and take a different action.
///
///
/// Since this exception is a subclass of SAXException, it inherits the ability to wrap another exception.
{
public:
public:
SAXParseException(const std::string& msg, const Locator& loc);
/// Create a new SAXParseException from a message and a Locator.
@@ -81,18 +81,18 @@ public:
SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber);
/// Create a new SAXParseException with an embedded exception.
///
///
/// This constructor is most useful for parser writers.
/// All parameters except the message are as if they were provided by a Locator.
/// For example, if the system identifier is a URL (including relative filename),
/// All parameters except the message are as if they were provided by a Locator.
/// For example, if the system identifier is a URL (including relative filename),
/// the caller must resolve it fully before creating the exception.
SAXParseException(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber, const Poco::Exception& exc);
/// Create a new SAXParseException.
///
///
/// This constructor is most useful for parser writers.
/// All parameters except the message are as if they were provided by a Locator.
/// For example, if the system identifier is a URL (including relative filename),
/// All parameters except the message are as if they were provided by a Locator.
/// For example, if the system identifier is a URL (including relative filename),
/// the caller must resolve it fully before creating the exception.
SAXParseException(const SAXParseException& exc);
@@ -103,7 +103,7 @@ public:
SAXParseException& operator = (const SAXParseException& exc);
/// Assignment operator.
const char* name() const noexcept;
/// Returns a static string describing the exception.
@@ -112,27 +112,27 @@ public:
Poco::Exception* clone() const;
/// Creates an exact copy of the exception.
void rethrow() const;
/// (Re)Throws the exception.
const XMLString& getPublicId() const;
/// Get the public identifier of the entity where the exception occurred.
const XMLString& getSystemId() const;
/// Get the system identifier of the entity where the exception occurred.
int getLineNumber() const;
/// The line number of the end of the text where the exception occurred.
/// The first line is line 1.
int getColumnNumber() const;
/// The column number of the end of the text where the exception occurred.
/// The first column in a line is position 1.
protected:
static std::string buildMessage(const std::string& msg, const XMLString& publicId, const XMLString& systemId, int lineNumber, int columnNumber);
private:
SAXParseException();

View File

@@ -35,7 +35,7 @@ class XML_API WhitespaceFilter: public XMLFilterImpl, public LexicalHandler
public:
WhitespaceFilter();
/// Creates the WhitespaceFilter, with no parent.
WhitespaceFilter(XMLReader* pReader);
/// Creates the WhitespaceFilter with the specified parent.

View File

@@ -29,27 +29,27 @@ namespace XML {
class XML_API XMLFilter: public XMLReader
/// Interface for an XML filter.
///
/// An XML filter is like an XML reader, except that it obtains its events from another XML reader
/// rather than a primary source like an XML document or database. Filters can modify a stream of
/// An XML filter is like an XML reader, except that it obtains its events from another XML reader
/// rather than a primary source like an XML document or database. Filters can modify a stream of
/// events as they pass on to the final application.
///
/// The XMLFilterImpl helper class provides a convenient base for creating SAX2 filters, by passing on
///
/// The XMLFilterImpl helper class provides a convenient base for creating SAX2 filters, by passing on
/// all EntityResolver, DTDHandler, ContentHandler and ErrorHandler events automatically.
{
public:
virtual XMLReader* getParent() const = 0;
/// Set the parent reader.
///
/// This method allows the application to link the filter to a parent reader (which may be another
///
/// This method allows the application to link the filter to a parent reader (which may be another
/// filter). The argument may not be null.
virtual void setParent(XMLReader* pParent) = 0;
/// Get the parent reader.
///
/// This method allows the application to query the parent reader (which may be another filter).
/// It is generally a bad idea to perform any operations on the parent reader directly: they should
///
/// This method allows the application to query the parent reader (which may be another filter).
/// It is generally a bad idea to perform any operations on the parent reader directly: they should
/// all pass through this filter.
protected:
virtual ~XMLFilter();
};

View File

@@ -33,25 +33,25 @@ namespace XML {
class XML_API XMLFilterImpl: public XMLFilter, public EntityResolver, public DTDHandler, public ContentHandler, public ErrorHandler
/// Base class for deriving an XML filter.
///
/// This class is designed to sit between an XMLReader and the client application's event
/// handlers. By default, it does nothing but pass requests up to the reader and events on to
/// the handlers unmodified, but subclasses can override specific methods to modify the event
/// This class is designed to sit between an XMLReader and the client application's event
/// handlers. By default, it does nothing but pass requests up to the reader and events on to
/// the handlers unmodified, but subclasses can override specific methods to modify the event
/// stream or the configuration requests as they pass through.
{
public:
XMLFilterImpl();
/// Construct an empty XML filter, with no parent.
///
/// This filter will have no parent: you must assign a parent before you start a parse or do any
/// configuration with setFeature or setProperty, unless you use this as a pure event consumer rather
/// This filter will have no parent: you must assign a parent before you start a parse or do any
/// configuration with setFeature or setProperty, unless you use this as a pure event consumer rather
/// than as an XMLReader.
XMLFilterImpl(XMLReader* pParent);
/// Construct an XML filter with the specified parent.
~XMLFilterImpl();
/// Destroys the XMLFilterImpl.
// XMLFilter
XMLReader* getParent() const;
void setParent(XMLReader* pParent);
@@ -77,7 +77,7 @@ public:
// EntityResolver
InputSource* resolveEntity(const XMLString* publicId, const XMLString& systemId);
void releaseInputSource(InputSource* pSource);
// DTDHandler
void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
@@ -104,10 +104,10 @@ protected:
/// Subclasses can use this method instead of
/// getParent() for better performance - this method
/// is non-virtual and implemented as inline.
virtual void setupParse();
/// Setup the event handlers in the parent reader.
private:
XMLReader* _pParent;
EntityResolver* _pEntityResolver;

View File

@@ -36,12 +36,12 @@ class NamespaceHandler;
class XML_API XMLReader
/// Interface for reading an XML document using callbacks.
/// XMLReader is the interface that an XML parser's SAX2 driver must
/// Interface for reading an XML document using callbacks.
/// XMLReader is the interface that an XML parser's SAX2 driver must
/// implement. This interface allows an application to set and
/// query features and properties in the parser, to register event handlers
/// query features and properties in the parser, to register event handlers
/// for document processing, and to initiate a document parse.
/// All SAX interfaces are assumed to be synchronous: the parse methods must not
/// All SAX interfaces are assumed to be synchronous: the parse methods must not
/// return until parsing is complete, and readers
/// must wait for an event-handler callback to return before reporting the next event.
{
@@ -49,10 +49,10 @@ public:
virtual void setEntityResolver(EntityResolver* pResolver) = 0;
/// Allow an application to register an entity resolver.
///
/// If the application does not register an entity resolver, the
/// If the application does not register an entity resolver, the
/// XMLReader will perform its own default resolution.
///
/// Applications may register a new or different resolver in the middle of a
///
/// Applications may register a new or different resolver in the middle of a
/// parse, and the SAX parser must begin using the new resolver immediately.
virtual EntityResolver* getEntityResolver() const = 0;
@@ -61,10 +61,10 @@ public:
virtual void setDTDHandler(DTDHandler* pDTDHandler) = 0;
/// Allow an application to register a DTD event handler.
///
/// If the application does not register a DTD handler, all DTD events reported by
/// If the application does not register a DTD handler, all DTD events reported by
/// the SAX parser will be silently ignored.
///
/// Applications may register a new or different handler in the middle of a parse,
///
/// Applications may register a new or different handler in the middle of a parse,
/// and the SAX parser must begin using the new handler immediately.
virtual DTDHandler* getDTDHandler() const = 0;
@@ -72,11 +72,11 @@ public:
virtual void setContentHandler(ContentHandler* pContentHandler) = 0;
/// Allow an application to register a content event handler.
///
/// If the application does not register a content handler, all content events
///
/// If the application does not register a content handler, all content events
/// reported by the SAX parser will be silently ignored.
///
/// Applications may register a new or different handler in the middle of a parse,
///
/// Applications may register a new or different handler in the middle of a parse,
/// and the SAX parser must begin using the new handler immediately.
virtual ContentHandler* getContentHandler() const = 0;
@@ -85,56 +85,56 @@ public:
virtual void setErrorHandler(ErrorHandler* pErrorHandler) = 0;
/// Allow an application to register an error event handler.
///
/// If the application does not register an error handler, all error events reported by
/// the SAX parser will be silently ignored; however, normal processing may not continue.
/// It is highly recommended that all SAX applications implement an error handler to avoid
/// If the application does not register an error handler, all error events reported by
/// the SAX parser will be silently ignored; however, normal processing may not continue.
/// It is highly recommended that all SAX applications implement an error handler to avoid
/// unexpected bugs.
///
/// Applications may register a new or different handler in the middle of a parse, and the
///
/// Applications may register a new or different handler in the middle of a parse, and the
/// SAX parser must begin using the new handler immediately.
virtual ErrorHandler* getErrorHandler() const = 0;
/// Return the current error handler.
virtual void setFeature(const XMLString& featureId, bool state) = 0;
/// Set the state of a feature.
///
/// The feature name is any fully-qualified URI. It is possible for an XMLReader to
/// expose a feature value but to be unable to change the current value. Some feature
/// values may be immutable or mutable only in specific contexts, such as before, during,
/// The feature name is any fully-qualified URI. It is possible for an XMLReader to
/// expose a feature value but to be unable to change the current value. Some feature
/// values may be immutable or mutable only in specific contexts, such as before, during,
/// or after a parse.
///
/// All XMLReaders are required to support setting http://xml.org/sax/features/namespaces
///
/// All XMLReaders are required to support setting http://xml.org/sax/features/namespaces
/// to true and http://xml.org/sax/features/namespace-prefixes to false.
virtual bool getFeature(const XMLString& featureId) const = 0;
/// Look up the value of a feature.
///
/// The feature name is any fully-qualified URI. It is possible for an XMLReader
/// to recognize a feature name but temporarily be unable to return its value.
/// Some feature values may be available only in specific contexts, such as before,
/// during, or after a parse. Also, some feature values may not be programmatically
/// accessible. (In the case of an adapter for SAX1 Parser, there is no
/// implementation-independent way to expose whether the underlying parser is performing
/// The feature name is any fully-qualified URI. It is possible for an XMLReader
/// to recognize a feature name but temporarily be unable to return its value.
/// Some feature values may be available only in specific contexts, such as before,
/// during, or after a parse. Also, some feature values may not be programmatically
/// accessible. (In the case of an adapter for SAX1 Parser, there is no
/// implementation-independent way to expose whether the underlying parser is performing
/// validation, expanding external entities, and so forth.)
///
/// All XMLReaders are required to recognize the
/// http://xml.org/sax/features/namespaces and the
///
/// All XMLReaders are required to recognize the
/// http://xml.org/sax/features/namespaces and the
/// http://xml.org/sax/features/namespace-prefixes feature names.
/// Implementors are free (and encouraged) to invent their own features,
/// Implementors are free (and encouraged) to invent their own features,
/// using names built on their own URIs.
virtual void setProperty(const XMLString& propertyId, const XMLString& value) = 0;
/// Set the value of a property.
///
/// The property name is any fully-qualified URI. It is possible for an XMLReader
/// to recognize a property name but to be unable to change the current value.
/// Some property values may be immutable or mutable only in specific contexts,
///
/// The property name is any fully-qualified URI. It is possible for an XMLReader
/// to recognize a property name but to be unable to change the current value.
/// Some property values may be immutable or mutable only in specific contexts,
/// such as before, during, or after a parse.
///
/// XMLReaders are not required to recognize setting any specific property names, though a
///
/// XMLReaders are not required to recognize setting any specific property names, though a
/// core set is defined by SAX2.
///
///
/// This method is also the standard mechanism for setting extended handlers.
virtual void setProperty(const XMLString& propertyId, void* value) = 0;
@@ -144,40 +144,40 @@ public:
virtual void* getProperty(const XMLString& propertyId) const = 0;
/// Look up the value of a property.
/// String values are returned as XMLChar*
/// The property name is any fully-qualified URI. It is possible for an XMLReader to
/// recognize a property name but temporarily be unable to return its value. Some property
/// The property name is any fully-qualified URI. It is possible for an XMLReader to
/// recognize a property name but temporarily be unable to return its value. Some property
/// values may be available only in specific contexts, such as before, during, or after a parse.
///
/// XMLReaders are not required to recognize any specific property names, though an initial
/// XMLReaders are not required to recognize any specific property names, though an initial
/// core set is documented for SAX2.
///
/// Implementors are free (and encouraged) to invent their own properties, using names
///
/// Implementors are free (and encouraged) to invent their own properties, using names
/// built on their own URIs.
virtual void parse(InputSource* pSource) = 0;
/// Parse an XML document.
///
/// The application can use this method to instruct the XML reader to begin parsing an
///
/// The application can use this method to instruct the XML reader to begin parsing an
/// XML document from any valid input source (a character stream, a byte stream, or a URI).
///
/// Applications may not invoke this method while a parse is in progress (they should create
/// a new XMLReader instead for each nested XML document). Once a parse is complete, an
/// application may reuse the same XMLReader object, possibly with a different input source.
/// Configuration of the XMLReader object (such as handler bindings and values established for
/// feature flags and properties) is unchanged by completion of a parse, unless the definition of that
/// aspect of the configuration explicitly specifies other behavior. (For example, feature flags or
///
/// Applications may not invoke this method while a parse is in progress (they should create
/// a new XMLReader instead for each nested XML document). Once a parse is complete, an
/// application may reuse the same XMLReader object, possibly with a different input source.
/// Configuration of the XMLReader object (such as handler bindings and values established for
/// feature flags and properties) is unchanged by completion of a parse, unless the definition of that
/// aspect of the configuration explicitly specifies other behavior. (For example, feature flags or
/// properties exposing characteristics of the document being parsed.)
///
/// During the parse, the XMLReader will provide information about the XML document through the registered
///
/// During the parse, the XMLReader will provide information about the XML document through the registered
/// event handlers.
///
/// This method is synchronous: it will not return until parsing has ended. If a client application
/// This method is synchronous: it will not return until parsing has ended. If a client application
/// wants to terminate parsing early, it should throw an exception.
virtual void parse(const XMLString& systemId) = 0;
/// Parse an XML document from a system identifier.
/// See also parse(InputSource*).
virtual void parseMemoryNP(const char* xml, std::size_t size) = 0;
/// Parse an XML document from memory.
/// See also parse(InputSource*).
@@ -189,7 +189,7 @@ public:
static const XMLString FEATURE_EXTERNAL_GENERAL_ENTITIES;
static const XMLString FEATURE_EXTERNAL_PARAMETER_ENTITIES;
static const XMLString FEATURE_STRING_INTERNING;
// SAX Properties
static const XMLString PROPERTY_DECLARATION_HANDLER;
static const XMLString PROPERTY_LEXICAL_HANDLER;

View File

@@ -33,33 +33,33 @@ class XML_API Name
public:
Name();
/// Creates an empty Name.
Name(const XMLString& qname);
/// Creates a Name from a qualified name only.
Name(const XMLString& qname, const XMLString& namespaceURI);
/// Creates a Name from a qualified name and a namespace URI.
/// The local name is extracted from the qualified name.
Name(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
/// Creates a Name from a qualified name, a namespace URI and a local name.
Name(const Name& name);
/// Copy constructor.
Name(Name&& name) noexcept;
/// Move constructor.
~Name();
/// Destroys the name.
Name& operator = (const Name& name);
/// Assignment operator.
Name& operator = (Name&& name) noexcept;
/// Move assignment.
void swap(Name& name);
void swap(Name& name) noexcept;
/// Swaps the name with another one.
void assign(const XMLString& qname);
@@ -71,31 +71,31 @@ public:
void assign(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
/// Assigns new values to the name.
bool equals(const Name& name) const;
/// Returns true if both names are equal.
bool equals(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns true if all the name's components are equal to the given ones.
bool equalsWeakly(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const;
/// Returns true if either the qnames are identical or the namespaceURIs and the localNames are identical.
const XMLString& qname() const;
/// Returns the qualified name.
const XMLString& namespaceURI() const;
/// Returns the namespace URI.
const XMLString& localName() const;
/// Returns the local name.
XMLString prefix() const;
/// Returns the namespace prefix.
static void split(const XMLString& qname, XMLString& prefix, XMLString& localName);
/// Splits the given qualified name into its prefix and localName parts.
static XMLString localName(const XMLString& qname);
/// Returns the local name part of the given qualified name.
@@ -132,7 +132,7 @@ inline const XMLString& Name::localName() const
}
inline void swap(Name& n1, Name& n2)
inline void swap(Name& n1, Name& n2) noexcept
{
n1.swap(n2);
}

View File

@@ -43,15 +43,15 @@ public:
NamePool(unsigned long size = POCO_XML_NAMEPOOL_DEFAULT_SIZE);
/// Creates a name pool with room for up to size strings.
///
/// The given size should be a suitable prime number,
/// The given size should be a suitable prime number,
/// e.g. 251, 509, 1021 or 4093.
const Name& insert(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
const Name& insert(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName);
/// Returns a const reference to an Name for the given names.
/// Creates the Name if it does not already exist.
/// Throws a PoolOverflowException if the name pool is full.
const Name& insert(const Name& name);
const Name& insert(const Name& name);
/// Returns a const reference to an Name for the given name.
/// Creates the Name if it does not already exist.
/// Throws a PoolOverflowException if the name pool is full.

View File

@@ -42,7 +42,7 @@ public:
virtual void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler) = 0;
/// Translate the arguments as delivered by Expat and
/// call the startElement() method of the ContentHandler.
virtual void endElement(const XMLChar* name, ContentHandler* pContentHandler) = 0;
/// Translate the arguments as delivered by Expat and
/// call the endElement() method of the ContentHandler.
@@ -62,10 +62,10 @@ class XML_API NoNamespacesStrategy: public NamespaceStrategy
public:
NoNamespacesStrategy();
~NoNamespacesStrategy();
void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
void endElement(const XMLChar* name, ContentHandler* pContentHandler);
private:
XMLString _name;
AttributesImpl _attrs;
@@ -79,7 +79,7 @@ class XML_API NoNamespacePrefixesStrategy: public NamespaceStrategy
public:
NoNamespacePrefixesStrategy();
~NoNamespacePrefixesStrategy();
void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
void endElement(const XMLChar* name, ContentHandler* pContentHandler);
@@ -97,10 +97,10 @@ class XML_API NamespacePrefixesStrategy: public NamespaceStrategy
public:
NamespacePrefixesStrategy();
~NamespacePrefixesStrategy();
void startElement(const XMLChar* name, const XMLChar** atts, int specifiedCount, ContentHandler* pContentHandler);
void endElement(const XMLChar* name, ContentHandler* pContentHandler);
private:
XMLString _uri;
XMLString _local;

View File

@@ -47,7 +47,7 @@ public:
QName& operator = (const QName& qname);
QName& operator = (QName&& qname) noexcept;
void swap(QName& qname);
void swap(QName& qname) noexcept;
const std::string& namespaceURI() const;
/// Returns the namespace URI part of the name.

View File

@@ -24,10 +24,10 @@
//
// The following block is the standard way of creating macros which make exporting
// The following block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the XML_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// that uses this DLL. This way any other project whose source files include this file see
// XML_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
//
@@ -35,7 +35,7 @@
#if defined(XML_EXPORTS)
#define XML_API __declspec(dllexport)
#else
#define XML_API __declspec(dllimport)
#define XML_API __declspec(dllimport)
#endif
#endif

View File

@@ -49,11 +49,11 @@ namespace XML {
std::string fromXMLString(const XMLString& str);
/// Converts an XMLString into an UTF-8 encoded
/// string.
XMLString toXMLString(const std::string& str);
/// Converts an UTF-8 encoded string into an
/// XMLString
#define XML_LIT(lit) L##lit
#elif defined(XML_UNICODE)
@@ -75,7 +75,7 @@ namespace XML {
{
return str;
}
#define XML_LIT(lit) lit
#endif

View File

@@ -42,9 +42,9 @@ class Locator;
class XML_API XMLWriter: public ContentHandler, public LexicalHandler, public DTDHandler
/// This class serializes SAX2 ContentHandler, LexicalHandler and
/// DTDHandler events back into a stream.
///
///
/// Various consistency checks are performed on the written data
/// (i.e. there must be exactly one root element and every startElement()
/// (i.e. there must be exactly one root element and every startElement()
/// must have a matching endElement()).
///
/// The XMLWriter supports optional pretty-printing of the serialized XML.
@@ -52,7 +52,7 @@ class XML_API XMLWriter: public ContentHandler, public LexicalHandler, public DT
/// information set of the document being written, since in
/// XML all whitespace is potentially relevant to an application.
///
/// The writer contains extensive support for XML Namespaces, so that a client
/// The writer contains extensive support for XML Namespaces, so that a client
/// application does not have to keep track of prefixes and supply xmlns attributes.
///
/// If the client does not provide namespace prefixes (either by specifying them
@@ -66,23 +66,23 @@ public:
CANONICAL = 0x00,
/// Do not write an XML declaration (default).
CANONICAL_XML = 0x01,
/// Enables basic support for Canonical XML:
CANONICAL_XML = 0x01,
/// Enables basic support for Canonical XML:
/// - do not write an XML declaration
/// - do not use special empty element syntax
/// - set the New Line character to NEWLINE_LF
/// - write namespace declarations and attributes
/// - write namespace declarations and attributes
/// in canonical order
/// - use default namespace as much as possible
WRITE_XML_DECLARATION = 0x02,
WRITE_XML_DECLARATION = 0x02,
/// Write an XML declaration.
PRETTY_PRINT = 0x04,
PRETTY_PRINT = 0x04,
/// Pretty-print XML markup.
PRETTY_PRINT_ATTRIBUTES = 0x08
/// Write each attribute on a separate line.
/// Write each attribute on a separate line.
/// PRETTY_PRINT must be specified as well.
};
@@ -129,7 +129,7 @@ public:
/// The given string should only contain TAB or SPACE
/// characters (e.g., a single TAB character, or
/// two to four SPACE characters).
const std::string& getIndent() const;
/// Returns the string used for one indentation step.
@@ -168,7 +168,7 @@ public:
void startElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
/// Writes an XML start element tag with no attributes.
/// See the other startElement() method for more information.
void endElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname);
/// Writes an XML end element tag.
///
@@ -186,7 +186,7 @@ public:
/// greater-than signs are escaped, unless a CDATA section
/// has been opened by calling startCDATA().
///
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// UTF-16 (if XMLChar is wchar_t).
void characters(const XMLString& str);
@@ -194,7 +194,7 @@ public:
/// greater-than signs are escaped, unless a CDATA section
/// has been opened by calling startCDATA().
///
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// UTF-16 (if XMLChar is wchar_t).
void rawCharacters(const XMLString& str);
@@ -202,7 +202,7 @@ public:
/// The caller is responsible for escaping characters as
/// necessary to produce valid XML.
///
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// The characters must be encoded in UTF-8 (if XMLChar is char) or
/// UTF-16 (if XMLChar is wchar_t).
void ignorableWhitespace(const XMLChar ch[], int start, int length);
@@ -222,7 +222,7 @@ public:
void skippedEntity(const XMLString& name);
/// Does nothing.
void dataElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& data,
void dataElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname, const XMLString& data,
const XMLString& attr1 = XMLString(), const XMLString& value1 = XMLString(),
const XMLString& attr2 = XMLString(), const XMLString& value2 = XMLString(),
const XMLString& attr3 = XMLString(), const XMLString& value3 = XMLString());
@@ -250,7 +250,7 @@ public:
void endEntity(const XMLString& name);
/// Does nothing.
// DTDHandler
void notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId);
void unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName);
@@ -268,12 +268,12 @@ public:
bool isNamespaceMapped(const XMLString& namespc) const;
/// Returns true if the given namespace has been mapped
/// to a prefix in the current element or its ancestors.
// Misc.
int depth() const;
/// Return the number of nested XML elements.
///
/// Will be -1 if no document or fragment has been started,
/// Will be -1 if no document or fragment has been started,
/// 0 if the document or fragment has been started,
/// 1 if the document element has been written and
/// > 1 for every element nested within the document element.
@@ -318,7 +318,7 @@ private:
XMLString namespaceURI;
};
typedef std::vector<Name> ElementStack;
Poco::OutputStreamConverter* _pTextConverter;
Poco::TextEncoding* _pInEncoding;
Poco::TextEncoding* _pOutEncoding;

View File

@@ -11,10 +11,11 @@
Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
@@ -174,8 +175,10 @@ struct XML_cp {
};
/* This is called for an element declaration. See above for
description of the model argument. It's the caller's responsibility
to free model when finished with it.
description of the model argument. It's the user code's responsibility
to free model when finished with it. See XML_FreeContentModel.
There is no need to free the model from the handler, it can be kept
around and freed at a later stage.
*/
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
const XML_Char *name,
@@ -237,6 +240,17 @@ XML_ParserCreate(const XML_Char *encoding);
and the local part will be concatenated without any separator.
It is a programming error to use the separator '\0' with namespace
triplets (see XML_SetReturnNSTriplet).
If a namespace separator is chosen that can be part of a URI or
part of an XML name, splitting an expanded name back into its
1, 2 or 3 original parts on application level in the element handler
may end up vulnerable, so these are advised against; sane choices for
a namespace separator are e.g. '\n' (line feed) and '|' (pipe).
Note that Expat does not validate namespace URIs (beyond encoding)
against RFC 3986 today (and is not required to do so with regard to
the XML 1.0 namespaces specification) but it may start doing that
in future releases. Before that, an application using Expat must
be ready to receive namespace URIs containing non-URI characters.
*/
XMLPARSEAPI(XML_Parser)
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
@@ -317,7 +331,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
const XML_Char *pubid,
int has_internal_subset);
/* This is called for the start of the DOCTYPE declaration when the
/* This is called for the end of the DOCTYPE declaration when the
closing > is encountered, but after processing any external
subset.
*/
@@ -1040,8 +1054,8 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold(
See http://semver.org.
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 4
#define XML_MICRO_VERSION 1
#define XML_MINOR_VERSION 5
#define XML_MICRO_VERSION 0
#ifdef __cplusplus
}