[Jslib] Problem with getAtribute() and removeAttribute()

Sudhakar Chandra thaths at openscroll.org
Tue Nov 4 16:43:19 EST 2003


Hello,

I am using the RDF library provided by JSLib 0.1.88 to access and change 
data stored in an RDF file.  I am having problems accessing an attribute 
with getAttribute() and removing it with removeAttribute().  I am able 
to add a new atrribute with setAttribute() just fine.

Here is how my RDF file looks:

<?xml version="1.0"?>
<RDF:RDF xmlns:RSSFEEDS="http://www.aunet.org/rdf#"
          xmlns:NC="http://home.netscape.com/NC-rdf#"
          xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

   <RDF:Seq about="urn:rssfeeds">
     <RDF:li resource="urn:rssfeeds:geek"/>
   </RDF:Seq>

   <RDF:Description about="urn:rssfeeds:geek" 
RSSFEEDS:CategoryName="Geek" />

   <RDF:Seq about="urn:rssfeeds:geek">
     <RDF:li resource="http://openscroll.org/rdfs/slashdot.xml"/>
     <RDF:li resource="http://openscroll.org/rdfs/metafilter.xml"/>
   </RDF:Seq>

   <RDF:Description about="http://openscroll.org/rdfs/slashdot.xml"
                    RSSFEEDS:FeedTitle="Slashdot"
                    RSSFEEDS:FeedComment="Slashdot.org"
                    RSSFEEDS:Category="geek"
 
RSSFEEDS:FeedURI="http://openscroll.org/rdfs/slashdot.xml"
                    RSSFEEDS:LastUpdate="Mon Nov 03 2003 16:27:15 
GMT-0800 (PST)" 
RSSFEEDS:Identifier="http://openscroll.org/rdfs/slashdot.xml" />

   <RDF:Description about="http://openscroll.org/rdfs/metafilter.xml"
                    RSSFEEDS:FeedTitle="Metafilter"
                    RSSFEEDS:FeedComment="Metafilter"
                    RSSFEEDS:Category="geek"
 
RSSFEEDS:FeedURI="http://openscroll.org/rdfs/metafilter.xml"
                    RSSFEEDS:LastUpdate="Mon Nov 03 2003 16:27:15 
GMT-0800 (PST)"
 
RSSFEEDS:Identifier="http://openscroll.org/rdfs/metafilter.xml" />


</RDF:RDF>


I am able to go upto the sequence urn:rssfeeds:geek just fine.  I am 
able to retrieve both the nodes from that sequence.

For each of the nodes, I am able to walk through the attributes 
(FeedTitle, FeedComment, Category, LastYpdate and Identifier) just fine 
using getAllAttributes() and attribute.name and attribute.value.

However, when I try something like:

var title = node[i].getAttribute("LastUpdate");
alert("Last update " + title);

I see the alert message as saying "Last update null".  BTW, I have to do 
the node[i] because I am walking through the nodes.


Furthermore, when I try something like:

node[i].removeAttribute("LastUpdate");
gRDF.flush();

the code halts at the removeAttribute() line.  JavaScript console does 
not show any messages.

Any help appreciated.

Thanks.

Thaths
-- 
Homer: I'm sick of this Tarzan movie
Lisa: Dad!  This is a documentary on the homeless.
Slacker At Large                            http://openscroll.org/
Key fingerprint = 8A 84 2E 67 10 9A 64 03  24 38 B6 AB 1B 6E 8C E4



More information about the Jslib mailing list