jmp wrote:

Hi,

What is the best/recommended way of loading XML from a cpp mozilla application?

{
 NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
 nsCOMPtr<nsIDOMXMLDocument>  pXMLDoc;
 do_CreateInstance(kXMLDocumentCID, &rv);
 pXMLDoc->SetAsync( false );
 PRBool retval = false;
 NS_NAMED_LITERAL_STRING(url , "http://mysite/myxml"; );
 pXMLDoc->Load( url , &retval );
}

Seems to work, but then when I use the nsCOMPtr<nsIDOMXPathEvaluator> to query the XML 
node, I always get an empty result set(stepped down to no document owner....) So i assume 
this is not the way to do it anymore (used to work with Mozilla 1.4.2, but not with mozilla 
1.7.2).

What is the best/recommented practice to do this ?

Thanks

JM



Might be worth it to try using the "async" loading model instead. In general, the async loading model is better supported by Mozilla for loading remote content. You'd of course need to setup a callback to be notified when the document has been fully loaded (I don't know the details of that off hand).


-Darin
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to