Looking at the documentation, it appears that DOMBuilder::parse(const DOMInputSource 
&source) should allow you to do what you want.  You'll need to construct the input 
source first, of course.  As part of that process, you can call 
DOMInputSource::setEncoding().

> -----Original Message-----
> From: Heeg, Michael [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, September 01, 2004 9:08 AM
> To: [EMAIL PROTECTED]
> Cc: Heeg, Michael
> Subject: Question concerning DOMBuilder and encoding
> 
> Hi everybody,
> 
> I have a problem with parsing a local file into a DOM. I 
> found out that the
> reason is the encoding the DOMBuilder uses (UTF-8 by 
> default?), but I did
> not find a way how to change it.
> 
> The problem is, that the local file has NO header line which sets the
> encoding like
> "<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>"
> If I add this line to the local file, the parsing works fine. But if I
> delete this line, the parsing process terminates with an 
> exception, because
> the document contains special characters like "°C" for degree 
> Celsius. And:
> due to compatibility it is not possible to include the header 
> line in the
> local files.
> 
> My question: is it possible to set the encoding the 
> DOMBuilder should use
> outside of the local file?
> 
> Thanks for your help!
> 
> Best regards,
> Michael Heeg
> 
> 
> Here are some fragments of my sources:
> 
> //member variables
> DOMDocument* m_domDoc;
> DOMBuilder* m_domBuilder;
> 
> //set external schema path
> XMLCh* propVal = XMLString::transcode("c:\myschema.xsd");
> m_domBuilder->setProperty(XMLUni::fgXercesSchemaExternalNoName
> SpaceSchemaLoc
> ation, propVal);
> 
> //parse document, transfer into the DOMDocument
> m_domDoc = m_domBuilder->parseURI("c:\myfile.txt");

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

Reply via email to