Hi,

I have a LPTSTR and want to create a DOM Document from that string. I use
a LPTSTR for unicode chars.

At the moment I am trying to use this:
------------------------------------------------------------------------
MemBufInputSource *memBufIS = new MemBufInputSource((const XMLByte*)xml,
wcslen(xml), "xmlRecord", false); // In this line xml is the LPTSTR that
contains the xml.
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(gLS);
DOMBuilder *parser =
((DOMImplementationLS*)impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,
0);
Wrapper4InputSource* domBufIS = NULL;
domBufIS = new Wrapper4InputSource ( memBufIS );
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = parser->parse(*domBufIS);
DOMElement * root = doc->getDocumentElement();
------------------------------------------------------------------------

This piece of code fails when it tries to parse the domBufIS and wants to
create a DOMDocument. If I debug this code the XMLByte from
MemBufInputSource seems to have only the first char from xml (a "<").

Are there better/other ways to create a DOMDocument from a LPTSTR?

TiA,

Alexander



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to