XMLCh* xcXML = dw->writeToString(*doc);
char *cXML = XMLString::transcode(xcXML);
delete dw;
aNode = doc->getFirstChild();
if (aNode->getNodeType() == DOMNode::ENTITY_NODE)
{
((DOMEntity *)aNode)->setEncoding(encNameStr);// never comes here.
}
-----Original Message-----
From: Scott Cantor [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: RE: DOMNode to char*Just write a link between the serializer and an ostream&. Then you can dump to cout or to a ostrstream or ostringstream and extract a char* from that.-- Scott-----Original Message-----
From: Milan Tomic [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 11:29 AM
To: [EMAIL PROTECTED]
Subject: 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.
