Thanks very much for your response.I found another way of doing it and it works 
well..
DOMLSInput* input = 
pImplement->createLSInput();input->setStringData(str);DOMLSParser *domparser = 
pImplement->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0);        
DOMDocument* domdoc = domparser->parse(input);
///////////////////////////
--- On Fri, 7/24/09, John Lilley <[email protected]> wrote:

From: John Lilley <[email protected]>
Subject: RE: How to create DOMDocument from XML string.
To: "[email protected]" <[email protected]>
Date: Friday, July 24, 2009, 9:28 AM

Have you tried something like this:

XN::XercesDOMParser parser;
// Adapt buffer to a form that can be read by the parser.
XN::MemBufInputSource inputSource(
    (const XMLByte *)str,
    (int)strlen(str),
    "system"        // fake "system ID"
);
parser.parse(inputSource);
doc = parser.adoptDocument();


-----Original Message-----
From: Rupanu Ranjaneswar [mailto:[email protected]] 
Sent: Friday, July 24, 2009 2:57 AM
To: [email protected]
Subject: How to create DOMDocument from XML string.

Hi , I was able to resolve the previous issue searching in the mail 
archieves.However UTF-16 to UTF-8 transcoding doesn't seem to be working.
I have a XMl string  (whole content of an XML file), please tell me how do i 
create a DOMDocument out of it. parse function of XercesDOMParser doesn't seem 
to be parsing an XML string..

regards rupanu.


      



      

Reply via email to