[Jslib] RDF resource getAttribute method

Damon Oehlman damon at sector17.com.au
Mon Nov 22 22:58:14 EST 2004

Hey All,

I was just wondering if anyone had come across a problem when using the 
jslib RDF functions.  I have an RDF datasource loaded from file and I am 
iterating through the nodes of the root sequence.  I can successfully 
iterate through the nodes to locate the node I am after, however, when I 
request the value of an attribute of that node, it returns null even if 
the named attribute exists.  A call to getAllAttributes does show that 
the attribute exists.  Any ideas? I have included a segment of the code 
below and would welcome any suggestions.


Example Javascript:

// iterate through the nodes of the sequence looking for the specified 
var	presentation_nodes = aseq.getSubNodes();
for (var ii = 0; ii < presentation_nodes.length;  ii++) {
   if (presentation_nodes[ii].getSubject() == presid) {
     dump("type = " + presentation_nodes[ii].getAttribute("filetype") + 
     var	attrlist = presentation_nodes[ii].getAllAttributes();
     for (var jj = 0; jj < attrlist.length; jj++) {
       dump("name: "+ attrlist[jj].name + " value: " + 
attrlist[jj].value + "\n");


Example RDF Node:

     <playlist:name>Test Flash Show</playlist:name>

More information about the Jslib mailing list