Title: DOMNode to char*

Berin,

    I have one (beginner) question. It is more about Xerces. I can't get DOMNode (and all its children nodes) as char*. In templatesign.exe there is a way to send DOMNode to standard output:

DOMNode *doc;
...
cout << doc;

    But, I dont wont to put doc in stdout, I'd like to put it into char* variable. Do you know how? Example:

char* result = doc->GetXML();// there is no GetXML() function

    I wrote this:

DOMWriter *dw = impl->createDOMWriter();
XMLCh* xcXML = dw->writeToString(*doc);
char *cXML = XMLString::transcode(xcXML);
delete dw;

    But, when save result (cXML) in file I got an error because this is UTF-16 encoding and I need UTF-8.

Thank you.

Reply via email to