Re: Reading data from firefox install.rdf with Javascript
Neil Deakin <[email protected]> Sun, 03 Apr 2005 13:05:25 -0400
| Newsgroups | gmane.comp.mozilla.devel.rdf |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
programmer wrote:
> I'm very new to RDF and I don't understand how I can determine the value (called literal??) associated
> to an attribute.
>
> Suppose I have this RDF
>
> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns:em="http://www.mozilla.org/2004/em-rdf#">
>
> <Description about="urn:mozilla:install-manifest">
> <em:id>{11111111-2222-3333-4444-555555555555}</em:id>
> <em:name>Extension name</em:name>
> ...
> ...
> ...
> <em:homepageURL>http://asimpleurl.com</em:homepageURL>
>
> How can I obtain the value http://asimpleurl.com??
>
> I tried code similar to this below but doesn't work.
>
> var rdfs = Components.classes["@mozilla.org/rdf/rdf-service;1"]
> .getService(Components.interfaces.nsIRDFService);
>
> var ds = rdfs.GetDataSourceBlocking("file:///tmp/install.rdf");
> var extension = rdfs.GetResource("11111111-2222-3333-4444-555555555555");
>
This line should be:
var extension = rdfs.GetResource("urn:mozilla:install-manifest");
/ Neil