yes, nsIDOMNSDocument do has a characterSet property. but It requires a
nsAString &charset argument.
I changed my code:
nsCString charset;
nsCOMPtr<nsIDOMNSDocument> doc = do_QueryInterface(aDocument);
NS_ASSERTION(doc, "Need a document");
doc->GetCharacterSet(charset);
when compile, I got:
../../../embedding/examples/Fox.cpp: In function `int main(int, char**)':
../../../embedding/examples/Fox.cpp:343: error: no matching function for
call to
`nsDerivedSafe<nsIDOMNSDocument>::GetCharacterSet(nsCString_external&)'
../../dist/include/dom/nsIDOMNSDocument.h:35: note: candidates are: virtual
nsresult nsIDOMNSDocument::GetCharacterSet(nsAString&)
gmake[1]: *** [Fox.o] Error 1
so, the same nsCString_external & nsAString problem.
The real problem is can I use nsIDocumentEncoder to serialize a
nsDOMDocument in an embedding program?
or what I am doing is totally wrong, because nsIDocumentEncoder is an
interface that shouldn't used in a glue-program?
Thanks - zz.
"Boris Zbarsky" <[email protected]>
??????:[email protected]...
> zz wrote:
>> Now, I think I can implement a nsHTMLSerializer class just like
>> nsDOMSerializer to solve this problem.
>> By the way, which DOM API can do the same document-dump thing?
>
> There isn't one, but there _is_ one that will give you the charset.
> nsIDOMNSDocument has a characterSet property.
>
> -Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding