2
* Copyright (c) 2003 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/2000/REC-xml-20001006#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>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.
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. The DOM Level 2 does not support any
44
* mechanism to resolve namespace prefixes.
45
* <p>See also the <a href='http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107'>Document Object Model (DOM) Level 3 Core Specification</a>.
47
public interface Entity extends Node {
49
* The public identifier associated with the entity if specified, and
50
* <code>null</code> otherwise.
52
public String getPublicId();
55
* The system identifier associated with the entity if specified, and
56
* <code>null</code> otherwise. This may be an absolute URI or not.
58
public String getSystemId();
61
* For unparsed entities, the name of the notation for the entity. For
62
* parsed entities, this is <code>null</code>.
64
public String getNotationName();
67
* An attribute specifying the encoding used for this entity at the time
68
* of parsing, when it is an external parsed entity. This is
69
* <code>null</code> if it an entity from the internal subset or if it
73
public String getInputEncoding();
76
* An attribute specifying, as part of the text declaration, the encoding
77
* of this entity, when it is an external parsed entity. This is
78
* <code>null</code> otherwise.
81
public String getXmlEncoding();
84
* An attribute specifying, as part of the text declaration, the version
85
* number of this entity, when it is an external parsed entity. This is
86
* <code>null</code> otherwise.
89
public String getXmlVersion();