DummyGUID = "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}";
const DIR_SERVICE = new Components.Constructor("@mozilla.org/file/directory_service;1","nsIProperties");
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
var path=(new DIR_SERVICE()).get("ProfD", Components.interfaces.nsIFile).path;
if (path.search(/\\/) != -1) { path = path + "\\"; } else { path = path + "/";}
path = path+"extensions\\"+DummyGUID+"\\xmls\\xmlsfilenm.xml";
file.initWithPath(path);
var is = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance( Components.interfaces.nsIFileInputStream );
is.init( file,0x01, 00004, null);
var sis = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance( Components.interfaces.nsIScriptableInputStream );
sis.init( is );
var detailoutput = sis.read( sis.available() ); //Detailoutput string will contain all texts
is.close();
// Now , you can perform XML Parsing using DOM Parser, read XML Parsing for complete tutorial
No comments:
Post a Comment