Edson E Watanabe wrote:
How to call correctly SerializeToString (from nsIDOMSerializer object)
in a XPCOM component? It is very easy to do it in JavaScript (new
XMLSerializer().SerializeToString(doc)), but I need to call it in C++.

I have created successfully a IDOMDocument (using ParseElement() from
the nsIDOMParser object) and populated it with nodes. (well, I think
so)
I have included the nsIDOMSerializer.h (created from
nsIDOMSerializer.idl)
I have to pass a PRUnichar** as the return parameter to
SerializeToString.

I tried to pass an address of a variable pointing to an uninitialized
buffer, and a pointer to a NULL pointer (because it seems to allocate
the string and return its address). Both tries didn't worked, and all
returned me the error 0x805303F4 (I searched the source code and
didn't find that code literally)


That error code is NS_ERROR_DOM_BAD_URI, which probably means that you created a document without a URI.


/ Neil




Reply via email to