1XML::DOM::Attr(3)     User Contributed Perl Documentation    XML::DOM::Attr(3)
2
3
4

NAME

6       XML::DOM::Attr - An XML attribute in XML::DOM
7

DESCRIPTION

9       XML::DOM::Attr extends XML::DOM::Node.
10
11       The Attr nodes built by the XML::DOM::Parser always have one child node
12       which is a Text node containing the expanded string value (i.e. Enti‐
13       tyReferences are always expanded.) EntityReferences may be added when
14       modifying or creating a new Document.
15
16       The Attr interface represents an attribute in an Element object.  Typi‐
17       cally the allowable values for the attribute are defined in a document
18       type definition.
19
20       Attr objects inherit the Node interface, but since they are not actu‐
21       ally child nodes of the element they describe, the DOM does not con‐
22       sider them part of the document tree. Thus, the Node attributes par‐
23       entNode, previousSibling, and nextSibling have a undef value for Attr
24       objects. The DOM takes the view that attributes are properties of ele‐
25       ments rather than having a separate identity from the elements they are
26       associated with; this should make it more efficient to implement such
27       features as default attributes associated with all elements of a given
28       type. Furthermore, Attr nodes may not be immediate children of a Docu‐
29       mentFragment. However, they can be associated with Element nodes con‐
30       tained within a DocumentFragment. In short, users and implementors of
31       the DOM need to be aware that Attr nodes have some things in common
32       with other objects inheriting the Node interface, but they also are
33       quite distinct.
34
35       The attribute's effective value is determined as follows: if this
36       attribute has been explicitly assigned any value, that value is the
37       attribute's effective value; otherwise, if there is a declaration for
38       this attribute, and that declaration includes a default value, then
39       that default value is the attribute's effective value; otherwise, the
40       attribute does not exist on this element in the structure model until
41       it has been explicitly added. Note that the nodeValue attribute on the
42       Attr instance can also be used to retrieve the string version of the
43       attribute's value(s).
44
45       In XML, where the value of an attribute can contain entity references,
46       the child nodes of the Attr node provide a representation in which
47       entity references are not expanded. These child nodes may be either
48       Text or EntityReference nodes. Because the attribute type may be
49       unknown, there are no tokenized attribute values.
50
51       METHODS
52
53       getValue
54           On retrieval, the value of the attribute is returned as a string.
55           Character and general entity references are replaced with their
56           values.
57
58       setValue (str)
59           DOM Spec: On setting, this creates a Text node with the unparsed
60           contents of the string.
61
62       getName
63           Returns the name of this attribute.
64
65
66
67perl v5.8.8                       2002-02-08                 XML::DOM::Attr(3)
Impressum