I've found a solution, but I hope there's an easier way. I have to manually
Unassert each property; appended code below:
Maybe n.p.m.rdf is the better venue?
/be
... //Name oProp = oRdf.GetResource("http://mozilla.org/package/jgillick/switchproxy/rdf#name") ; oDs.Unassert(oProxy, oProp, oDs.GetTarget(oProxy, oProp, true));
//Id oProp = oRdf.GetResource("http://mozilla.org/package/jgillick/switchproxy/rdf#id"); oDs.Unassert(oProxy, oProp, oDs.GetTarget(oProxy, oProp, true));
//Proxy Url oProp = oRdf.GetResource("http://mozilla.org/package/jgillick/switchproxy/rdf#proxy" ); oDs.Unassert(oProxy, oProp, oDs.GetTarget(oProxy, oProp, true)); ...
Is there an easier way to do all of this?
Thanks, Jeremy
"Jeremy Gillick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have an application that adds data to the 'rdf:localstore'. When I addan
entry it looks something like this:remove
<RDF:Seq about="http://mozilla.org/package/jgillick/switchproxy/rdf/all"> <RDF:li resource="http://mozilla.org/package/jgillick/switchproxy/rdf/all/test"/> </RDF:Seq> <RDF:Description about="http://mozilla.org/package/jgillick/switchproxy/rdf/all/test" NS4:name="test"
NS4:id="http://mozilla.org/package/jgillick/switchproxy/rdf/all/test" NS4:proxy="test" />
When I try to remove
http://mozilla.org/package/jgillick/switchproxy/rdf/all/test, it only
the <RDF:LI> tag in the Seq block, but leaves the <RDF:Description> tag.same
This causes problems when somebody tries to add an item later with the
name, which coorisponds to the about attribute. I need to be able toremove
the LI reference and the actual data."http://mozilla.org/package/jgillick/switchproxy/rdf/all";
The code I'm currently using to remove the item is below:
-----------------------------------------
const gRdfDataSouce = "rdf:localstore";
const gRdfRoot =
Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.ivar oItem = document.getElementById('proxy-list').selectedItem; var oRdf =
Components.classes["@mozilla.org/rdf/container;1"].createInstance(Componentsnterfaces.nsIRDFService); var oRdfC =
.interfaces.nsIRDFContainer); var oDs = oRdf.GetDataSource(gRdfDataSouce); var oRoot = oRdf.GetResource(gRdfRoot); var oProxy = oRdf.GetResource(oItem.id);
oRdfC.Init(oDs, oRoot);
//Remove oRdfC.RemoveElement(oProxy, true); -----------------------------------------
In this example, oItem.id equals "http://mozilla.org/package/jgillick/switchproxy/rdf/all/test"
Thanks, Jeremy
n _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
