You can construct a MemBufInputSource and pass it to your parser.
Something like:

    MemBufInputSource Source((XMLByte *) lpText, nTextLength, L"");

    XercesDOMParser Parser;
    Parser.parse(Source);

If you want to use DOMBuilder instead of one of the ...Parser classes,
you'll need to wrap the MemBufInputSource in a Wrapper4InputSource
object, something like the following untested code (which assumes you've
already created a DOMBuilder named pBuilder):

    MemBufInputSource * pSource = new MemBufInputSource((XMLByte *)
lpText, nTextLength, L"");
    Wrapper4InputSource Wrapper(pSource); // adopts pSource by default

    pBuilder->parse(Wrapper);

> -----Original Message-----
> From: Matthias Niggemeier [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 24, 2005 9:13 AM
> To: [email protected]
> Subject: RE: Writing to String
> 
> > -----Original Message-----
> > From: dara [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, June 23, 2005 6:35 PM
> > To: [email protected]
> > Subject: Re: Writing to String
> > I think writeToString _always_ outputs UTF16. Even when you set the 
> > document encoding to something else. It says this 
> somewhere, but it's 
> > not clear in the docs (xerces v2.4.0) and took me a while to 
> > find out, 
> > mega frustration !
> > 
> > If you want to output utf-8, iso-8859-1, etc, I believe you 
> have set 
> > that encoding in the document (DOM) and then use a format 
> > target to get 
> > your output.
> 
> Dara,
> thanks for your help, you saved my day :-)
> Your code worked for me "as is".
> 
> Is it possible to re-parse the string? Assume I have
> the XML data in memory (as char* for example), how can
> I parse this? I haven't found a way to create a DOMInputSource
> from something that is in memory.
> 
> Regards
> 
> Matthias
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to