|
|
Element inherits from Node.
Returns the tag name.
Returns null.
Returns the node type, ELEMENT_NODE.
Returns the value of the attribute.
Element Attributes
xml = caucho.xml.Xml.parseString('<elt a="3" b="4" c="5"/>');
elt = xml.documentElement
for (var name in elt.attribute)
writeln(name + ' ' + elt.attribute[name])
|
b 4
a 3
c 5
|
setAttribute(name, value)
|
Sets an attribute value.
Setting Element Attributes
xml = caucho.xml.Xml.parseString('<elt a="3" b="4" c="5"/>');
elt = xml.documentElement
elt.attribute.c = 76
elt.print(out)
|
<elt a="3" b="4" c="76"/>
|
Removes an attribute.
Merges adjacent text nodes. This is recursive.
getElementsByTagName(name)
|
Returns a NodeList of all child elements with tag
name name .
xml = caucho.xml.Xml.parseString(@<<END);
<top>
<foo a='1'/>
<foo a='2'>
<foo a='3'/>
</foo>
</top>
END
elt = xml.documentElement
for (var node in elt.getElementsByTagName('foo')) {
writeln(node.attribute.a);
}
|
1
2
3
|
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:56:59 -0800 (PST)
|