EntityReference.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #ifndef DOM_EntityReference_INCLUDED
  16. #define DOM_EntityReference_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/DOM/AbstractNode.h"
  19. #include "Poco/XML/XMLString.h"
  20. namespace Poco {
  21. namespace XML {
  22. class XML_API EntityReference: public AbstractNode
  23. /// EntityReference objects may be inserted into the structure model when an
  24. /// entity reference is in the source document, or when the user wishes to insert
  25. /// an entity reference. Note that character references and references to predefined
  26. /// entities are considered to be expanded by the HTML or XML processor so that
  27. /// characters are represented by their Unicode equivalent rather than by an
  28. /// entity reference. Moreover, the XML processor may completely expand references
  29. /// to entities while building the structure model, instead of providing EntityReference
  30. /// objects. If it does provide such objects, then for a given EntityReference
  31. /// node, it may be that there is no Entity node representing the referenced
  32. /// entity. If such an Entity exists, then the child list of the EntityReference
  33. /// node is the same as that of the Entity node.
  34. ///
  35. /// As for Entity nodes, EntityReference nodes and all their descendants are
  36. /// readonly.
  37. ///
  38. /// The resolution of the children of the EntityReference (the replacement value
  39. /// of the referenced Entity) may be lazily evaluated; actions by the user (such
  40. /// as calling the childNodes method on the EntityReference node) are assumed
  41. /// to trigger the evaluation.
  42. {
  43. public:
  44. // Node
  45. const XMLString& nodeName() const;
  46. unsigned short nodeType() const;
  47. protected:
  48. EntityReference(Document* pOwnerDocument, const XMLString& name);
  49. EntityReference(Document* pOwnerDocument, const EntityReference& ref);
  50. ~EntityReference();
  51. Node* copyNode(bool deep, Document* pOwnerDocument) const;
  52. private:
  53. XMLString _name;
  54. friend class Document;
  55. };
  56. } } // namespace Poco::XML
  57. #endif // DOM_EntityReference_INCLUDED