[Jslib] jslib rdf function call problem

Pete Collins pete at mozdevgroup.com
Fri May 14 11:13:41 EDT 2004


I don't have the time to answer this.

Anyone else using the rdf lib have any suggestions?

Thanks

--pete

Peter Janker wrote:

>I have read that one should use the rdf/rdf.js version in jslib.
>Unfortunately I have some problems in calling some functions of the jslib RDF.
>The examples are from: http://jslib.mozdev.org/libraries/rdf/rdf.html#RDF 
>
>
>If I open a new not existing file by:
>
>var gRDF = new RDFFile(tmppath,null,'http://www.no-adress.de/something#','myid'); 
>
>I receive an error after
>
>var seq = gRDF.getRootSeq("urn");
>var newseq = seq.addSeq("root");
>
>The error is:
>[Exception...
>"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIRDFContainer.Init]" 
>nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://jslib/content/rdf/
>rdfContainer.js :: anonymous :: line 69" data: no] 
>
>This is probabely due to the fact that the container does not exist, but if I create a node by 
>
>var seq = gRDF.getNode("urn:root");
>seq.setAttribute("name", "theroot");
>gRDF.flush;
>
>and I try to convert the node to a seq by 
>
>var node = gRDF.getNode("urn:root");
>var newseq = node.makeSeq();
>var addressnode = newseq.addNode("address"); gRDF.flush;
>
>I get the error:
>[Exception...
>"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIRDFContainer.Init]" 
>nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://jslib/content/rdf/
>rdfResource.js :: anonymous :: line 80" data: no] 
>
>The resulting file is:
>
><?xml version="1.0"?>
><RDF:RDF xmlns:myid="http://www.no-adress.de/something#" 
>xmlns:NC="http://home.netscape.com/NC-rdf#" xmlns:RDF="http://www.w3.org/1999/02/22-rdf-
>syntax-ns#"> <RDF:Description RDF:about="urn:root"
>name="theroot" />
></RDF:RDF>
>
>
>My Question now is
>How can I call the functions to manipulate the rdf in a proper way to create container, resources, 
>nodes usw. 
>
>-----
>Peter Janker
>
>P.S.
>The old example at http://books.mozdev.org/html/mozilla-chp-10-sect-5.html 
>with the io/rdf.js is working. But how can I set the namespace-id in this rdf-constructor instead of 
>'xmlns:SIMPLE' to the one, I would like to use and how can I fix the root to 'urn:root' instead of 
>'something:data'? 
>_____________________________________________________________________
>Der WEB.DE Virenschutz schuetzt Ihr Postfach vor dem Wurm Netsky.A-P!
>Kostenfrei fuer alle FreeMail Nutzer. http://f.web.de/?mc=021157
>
>_______________________________________________
>Jslib mailing list
>Jslib at mozdev.org
>http://mozdev.org/mailman/listinfo/jslib
>
>
>  
>


-- 
Pete Collins
www.mozdev.org
www.mozdevgroup.com




More information about the Jslib mailing list