1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package org.w3c.dom;
  13. /**
  14. * This interface represents an entity, either parsed or unparsed, in an XML
  15. * document. Note that this models the entity itself not the entity
  16. * declaration. <code>Entity</code> declaration modeling has been left for a
  17. * later Level of the DOM specification.
  18. * <p>The <code>nodeName</code> attribute that is inherited from
  19. * <code>Node</code> contains the name of the entity.
  20. * <p>An XML processor may choose to completely expand entities before the
  21. * structure model is passed to the DOM; in this case there will be no
  22. * <code>EntityReference</code> nodes in the document tree.
  23. * <p>XML does not mandate that a non-validating XML processor read and
  24. * process entity declarations made in the external subset or declared in
  25. * external parameter entities. This means that parsed entities declared in
  26. * the external subset need not be expanded by some classes of applications,
  27. * and that the replacement value of the entity may not be available. When
  28. * the replacement value is available, the corresponding <code>Entity</code>
  29. * node's child list represents the structure of that replacement text.
  30. * Otherwise, the child list is empty.
  31. * <p>The DOM Level 2 does not support editing <code>Entity</code> nodes; if a
  32. * user wants to make changes to the contents of an <code>Entity</code>,
  33. * every related <code>EntityReference</code> node has to be replaced in the
  34. * structure model by a clone of the <code>Entity</code>'s contents, and
  35. * then the desired changes must be made to each of those clones instead.
  36. * <code>Entity</code> nodes and all their descendants are readonly.
  37. * <p>An <code>Entity</code> node does not have any parent.If the entity
  38. * contains an unbound namespace prefix, the <code>namespaceURI</code> of
  39. * the corresponding node in the <code>Entity</code> node subtree is
  40. * <code>null</code>. The same is true for <code>EntityReference</code>
  41. * nodes that refer to this entity, when they are created using the
  42. * <code>createEntityReference</code> method of the <code>Document</code>
  43. * interface. The DOM Level 2 does not support any mechanism to resolve
  44. * namespace prefixes.
  45. * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
  46. */
  47. public interface Entity extends Node {
  48. /**
  49. * The public identifier associated with the entity, if specified. If the
  50. * public identifier was not specified, this is <code>null</code>.
  51. */
  52. public String getPublicId();
  53. /**
  54. * The system identifier associated with the entity, if specified. If the
  55. * system identifier was not specified, this is <code>null</code>.
  56. */
  57. public String getSystemId();
  58. /**
  59. * For unparsed entities, the name of the notation for the entity. For
  60. * parsed entities, this is <code>null</code>.
  61. */
  62. public String getNotationName();
  63. }