On May 5, 9:31 pm, Ranju <ora...@gmail.com> wrote:
> > 1)  Is the URI of the document you're looking at there correct?
>
> Yes.
>
> > 2)  What happens if you try to get the documentElement of that document?
> > 3)  What happens if you try to get the childNodes of that document and
> >      look at its length?
>
> Sorry for my ignorance, but what snippets of code do 2 & 3 correspond
> to?

Hey Ranju,

I downloaded and tried your code. I got the same error. The program
would crash on line 52. If I commented out lines 52 & 53, the program
would run sucessfully.

So, I replaced lines 52 & 53 with
       // crashes on this line
       //rv = domDocument->GetElementsByTagName(NS_LITERAL_STRING
("*"),getter_AddRefs(nodelist));
       //if (NS_FAILED(rv)) printf("GetElements by tag name failed %08X
\n", rv);

           nsIDOMElement * blah;
       rv = domDocument->GetDocumentElement(&blah);
       if (NS_FAILED(rv)) printf("Getting document element failed %08X
\n", rv);

           // but now crashes on this line.
       rv = blah->GetElementsByTagName(NS_LITERAL_STRING("*"),
getter_AddRefs(nodelist));
       if (NS_FAILED(rv)) printf("Getting elements by tagname failed.
%08X\n", rv);

Basically, what I did was get the documentElement of the document and
then tried GetElementsByTagName on that. Still crashes.

I'm not sure how to get the childNodes of the document though.

Other people have had this problem too. Perhaps this is a bug?

-Sean
http://seanneilan.com
_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to