4
// $Id: //poco/1.2/XML/include/Poco/DOM/Entity.h#1 $
10
// Definition of the DOM Entity class.
12
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
15
// Permission is hereby granted, free of charge, to any person or organization
16
// obtaining a copy of the software and accompanying documentation covered by
17
// this license (the "Software") to use, reproduce, display, distribute,
18
// execute, and transmit the Software, and to prepare derivative works of the
19
// Software, and to permit third-parties to whom the Software is furnished to
20
// do so, all subject to the following:
22
// The copyright notices in the Software and this entire statement, including
23
// the above license grant, this restriction and the following disclaimer,
24
// must be included in all copies of the Software, in whole or in part, and
25
// all derivative works of the Software, unless such copies or derivative
26
// works are solely in the form of machine-executable object code generated by
27
// a source language processor.
29
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35
// DEALINGS IN THE SOFTWARE.
39
#ifndef DOM_Entity_INCLUDED
40
#define DOM_Entity_INCLUDED
43
#include "Poco/XML/XML.h"
44
#include "Poco/DOM/AbstractContainerNode.h"
45
#include "Poco/XML/XMLString.h"
52
class XML_API Entity: public AbstractContainerNode
53
/// This interface represents an entity, either parsed or unparsed, in an XML
54
/// document. Note that this models the entity itself not the entity declaration.
55
/// Entity declaration modeling has been left for a later Level of the DOM
58
/// The nodeName attribute that is inherited from Node contains the name of
61
/// An XML processor may choose to completely expand entities before the structure
62
/// model is passed to the DOM; in this case there will be no EntityReference
63
/// nodes in the document tree.
65
/// XML does not mandate that a non-validating XML processor read and process
66
/// entity declarations made in the external subset or declared in external
67
/// parameter entities. This means that parsed entities declared in the external
68
/// subset need not be expanded by some classes of applications, and that the
69
/// replacement value of the entity may not be available. When the replacement
70
/// value is available, the corresponding Entity node's child list represents
71
/// the structure of that replacement text. Otherwise, the child list is empty.
73
/// The resolution of the children of the Entity (the replacement value) may
74
/// be lazily evaluated; actions by the user (such as calling the childNodes
75
/// method on the Entity Node) are assumed to trigger the evaluation.
77
/// The DOM Level 1 does not support editing Entity nodes; if a user wants to
78
/// make changes to the contents of an Entity, every related EntityReference
79
/// node has to be replaced in the structure model by a clone of the Entity's
80
/// contents, and then the desired changes must be made to each of those clones
81
/// instead. Entity nodes and all their descendants are readonly.
83
/// An Entity node does not have any parent.
86
const XMLString& publicId() const;
87
/// Returns the public identifier associated with
88
/// the entity, if specified. If the public identifier
89
/// was not specified, this is the empty string.
91
const XMLString& systemId() const;
92
/// Returns the system identifier associated with
93
/// the entity, if specified. If the system identifier
94
/// was not specified, this is the empty string.
96
const XMLString& notationName() const;
97
/// Returns, for unparsed entities, the name of the
98
/// notation for the entity. For parsed entities, this
99
/// is the empty string.
102
const XMLString& nodeName() const;
103
unsigned short nodeType() const;
106
Entity(Document* pOwnerDocument, const XMLString& name, const XMLString& publicId, const XMLString& systemId, const XMLString& notationName);
107
Entity(Document* pOwnerDocument, const Entity& entity);
110
Node* copyNode(bool deep, Document* pOwnerDocument) const;
113
static const XMLString NODE_NAME;
118
XMLString _notationName;
120
friend class Document;
127
inline const XMLString& Entity::publicId() const
133
inline const XMLString& Entity::systemId() const
139
inline const XMLString& Entity::notationName() const
141
return _notationName;
145
} } // namespace Poco::XML
148
#endif // DOM_Entity_INCLUDED