| 1 | // |
| 2 | // EntityReference.h |
| 3 | // |
| 4 | // Library: XML |
| 5 | // Package: DOM |
| 6 | // Module: DOM |
| 7 | // |
| 8 | // Definition of the DOM EntityReference class. |
| 9 | // |
| 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 11 | // and Contributors. |
| 12 | // |
| 13 | // SPDX-License-Identifier: BSL-1.0 |
| 14 | // |
| 15 | |
| 16 | |
| 17 | #ifndef DOM_EntityReference_INCLUDED |
| 18 | #define DOM_EntityReference_INCLUDED |
| 19 | |
| 20 | |
| 21 | #include "Poco/XML/XML.h" |
| 22 | #include "Poco/DOM/AbstractNode.h" |
| 23 | #include "Poco/XML/XMLString.h" |
| 24 | |
| 25 | |
| 26 | namespace Poco { |
| 27 | namespace XML { |
| 28 | |
| 29 | |
| 30 | class XML_API EntityReference: public AbstractNode |
| 31 | /// EntityReference objects may be inserted into the structure model when an |
| 32 | /// entity reference is in the source document, or when the user wishes to insert |
| 33 | /// an entity reference. Note that character references and references to predefined |
| 34 | /// entities are considered to be expanded by the HTML or XML processor so that |
| 35 | /// characters are represented by their Unicode equivalent rather than by an |
| 36 | /// entity reference. Moreover, the XML processor may completely expand references |
| 37 | /// to entities while building the structure model, instead of providing EntityReference |
| 38 | /// objects. If it does provide such objects, then for a given EntityReference |
| 39 | /// node, it may be that there is no Entity node representing the referenced |
| 40 | /// entity. If such an Entity exists, then the child list of the EntityReference |
| 41 | /// node is the same as that of the Entity node. |
| 42 | /// |
| 43 | /// As for Entity nodes, EntityReference nodes and all their descendants are |
| 44 | /// readonly. |
| 45 | /// |
| 46 | /// The resolution of the children of the EntityReference (the replacement value |
| 47 | /// of the referenced Entity) may be lazily evaluated; actions by the user (such |
| 48 | /// as calling the childNodes method on the EntityReference node) are assumed |
| 49 | /// to trigger the evaluation. |
| 50 | { |
| 51 | public: |
| 52 | // Node |
| 53 | const XMLString& nodeName() const; |
| 54 | unsigned short nodeType() const; |
| 55 | |
| 56 | protected: |
| 57 | EntityReference(Document* pOwnerDocument, const XMLString& name); |
| 58 | EntityReference(Document* pOwnerDocument, const EntityReference& ref); |
| 59 | ~EntityReference(); |
| 60 | |
| 61 | Node* copyNode(bool deep, Document* pOwnerDocument) const; |
| 62 | |
| 63 | private: |
| 64 | XMLString _name; |
| 65 | |
| 66 | friend class Document; |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | } } // namespace Poco::XML |
| 71 | |
| 72 | |
| 73 | #endif // DOM_EntityReference_INCLUDED |
| 74 | |