[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.

Thanks,
Damon.

Example Javascript:
-------------------

// iterate through the nodes of the sequence looking for the specified 
presentation
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") + 
"\n");
     var	attrlist = presentation_nodes[ii].getAllAttributes();
     for (var jj = 0; jj < attrlist.length; jj++) {
       dump("name: "+ attrlist[jj].name + " value: " + 
attrlist[jj].value + "\n");
     }

     break;
   }
}

Example RDF Node:
-----------------

<RDF:li>
   <RDF:Description 
about="http://mediacortex.digitalmache.org/presentation/testflash">
     <playlist:name>Test Flash Show</playlist:name>
     <playlist:filetype>flash</playlist:filetype>
   </RDF:Description>
</RDF:li>


More information about the Jslib mailing list