|
|
Returns '#document'
Returns DOCUMENT_NODE
Returns the top level element of the document.
xml = caucho.xml.Xml.parseString("<foo/>");
xml.documentElement.nodeName
|
foo
|
Creates a new element for this document.
xml = caucho.xml.Xml.parseString("<top/>");
elt = xml.createElement("bar");
xml.documentElement.appendChild(elt);
xml.print(out);
|
<top><bar/></top>
|
Creates a new text for this document.
xml = caucho.xml.Xml.parseString("<top/>");
text = xml.createTextNode("hello, world");
xml.documentElement.appendChild(text);
xml.print(out);
|
<top>hello, world</top>
|
Creates a new comment for this document.
xml = caucho.xml.Xml.parseString("<top/>");
text = xml.createComment(" test comment ");
xml.documentElement.appendChild(text);
xml.print(out);
|
<top><!-- test comment --></top>
|
Creates a new CData section for this document.
xml = caucho.xml.Xml.parseString("<top/>");
text = xml.createCDATASection(" test < cdata ");
xml.documentElement.appendChild(text);
xml.print(out);
|
<top><![CDATA[ test < cdata ]]></top>
|
createProcessingInstruction(target, data)
|
Creates a new processing instruction for this document.
xml = caucho.xml.Xml.parseString("<top/>");
text = xml.createProcessingInstruction("caucho", "debug");
xml.documentElement.appendChild(text);
xml.print(out);
|
<top><?caucho log?></top>
|
Creates a new attribute.
createEntityReference(name)
|
Creates a new entity reference.
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
for (var node in xml.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:49 -0800 (PST)
|