gecko-dev/rdf/resources/dom-test-2.xul

56 lines
1.4 KiB
Plaintext
Raw Normal View History

<?xml version="1.0"?>
1999-04-06 06:37:52 +00:00
<!--
This test exercises some of the DOMAttr stuff.
-->
<?xml-stylesheet href="dom-test-1.css" type="text/css"?>
<xul:window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/TR/WD-rdf-syntax#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script>
function DumpAttributes()
{
var bookmarksRoot = document.getElementById("NC:BookmarksRoot");
dump("bookmarksRoot = " + bookmarksRoot + "\n");
if (bookmarksRoot == null)
return;
var attrs = bookmarksRoot.attributes;
dump("attrs = " + attrs + "\n");
if (attrs == null)
return;
for (var i = 0; i &lt; attrs.length; ++i) {
1999-04-06 06:37:52 +00:00
var attr = attrs[i];
dump("attrs[" + i + "] = " + attr + "\n");
if (attr != null) {
dump("attr.name = " + attr.name + "\n");
dump("attr.value = " + attr.value + "\n");
}
}
}
</html:script>
<html:button onclick="DumpAttributes();">DumpAttributes</html:button>
<tree id="tree" datasources="rdf:bookmarks" onclick="return OpenURL(event,event.target.parentNode);">
<treecol rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
<treecol rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
<treehead>
<treeitem>
<treecell>Name</treecell>
<treecell>URL</treecell>
</treeitem>
</treehead>
<treebody id="NC:BookmarksRoot">
</treebody>
</tree>
</xul:window>