2 * Copyright (c) 2004 World Wide Web Consortium,
4 * (Massachusetts Institute of Technology, European Research Consortium for
5 * Informatics and Mathematics, Keio University). All Rights Reserved. This
6 * work is distributed under the W3C(r) Software License [1] in the hope that
7 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
8 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
16 * This interface represents a known entity, either parsed or unparsed, in an
17 * XML document. Note that this models the entity itself <em>not</em> the entity declaration.
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 * parameter entities. This means that parsed entities declared in the
26 * external subset need not be expanded by some classes of applications, and
27 * that the replacement text of the entity may not be available. When the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#intern-replacement'>
28 * replacement text</a> is available, the corresponding <code>Entity</code> node's child list
29 * represents the structure of that replacement value. Otherwise, the child
31 * <p>DOM Level 3 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.
38 * <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the
39 * <code>namespaceURI</code> of the corresponding node in the
40 * <code>Entity</code> node subtree is <code>null</code>. The same is true
41 * for <code>EntityReference</code> nodes that refer to this entity, when
42 * they are created using the <code>createEntityReference</code> method of
43 * the <code>Document</code> interface.
44 * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
46 public interface Entity
extends Node
{
48 * The public identifier associated with the entity if specified, and
49 * <code>null</code> otherwise.
51 public String
getPublicId();
54 * The system identifier associated with the entity if specified, and
55 * <code>null</code> otherwise. This may be an absolute URI or not.
57 public String
getSystemId();
60 * For unparsed entities, the name of the notation for the entity. For
61 * parsed entities, this is <code>null</code>.
63 public String
getNotationName();
66 * An attribute specifying the encoding used for this entity at the time
67 * of parsing, when it is an external parsed entity. This is
68 * <code>null</code> if it an entity from the internal subset or if it
72 public String
getInputEncoding();
75 * An attribute specifying, as part of the text declaration, the encoding
76 * of this entity, when it is an external parsed entity. This is
77 * <code>null</code> otherwise.
80 public String
getXmlEncoding();
83 * An attribute specifying, as part of the text declaration, the version
84 * number of this entity, when it is an external parsed entity. This is
85 * <code>null</code> otherwise.
88 public String
getXmlVersion();