I don't think there is another way. It doesn't seem like a hack to me! The DomDocument set version function is for when you want to build a document in memory. The document is then correctly serialised with a 1.1 XML declaration. But I don't see how that would help with parsing.
Tony >-----Original Message----- >From: Vincent Finn [mailto:[EMAIL PROTECTED] >Sent: 06 April 2005 12:44 >To: xerces-c-dev@xml.apache.org >Subject: RE: control characters in the Xml > >Hi, > >That worked perfectly but I have one more question > >Is there a way of programmatically setting the version to "1.1"? > >If you have no XML declaration (the file I'm dealing with >don't) it defaults to version "1.0" >I can prepend '<?xml version="1.1"?>' to the string before >parsing but that seems like a hack > >There is a setVersion function on DOMEntity and DOMDocument >but the exception is thrown during parse so that is no good to me > > Vin > >> -----Original Message----- >> From: Tony Dodd [mailto:[EMAIL PROTECTED] >> Sent: 05 April 2005 16:27 >> To: xerces-c-dev@xml.apache.org >> Subject: RE: control characters in the Xml >> >> >> If you set XML version to 1.1 these characters are legal, though you >> must still escape them. >> >> Tony Dodd >> >> >-----Original Message----- >> >From: Vincent Finn [mailto:[EMAIL PROTECTED] >> >Sent: 05 April 2005 15:46 >> >To: xerces-c-dev@xml.apache.org >> >Subject: control characters in the Xml >> > >> >Hi, >> > >> >I know this isn't really a developer question but there >isn't a user >> >list so I figured this one might do >> > >> >I have a very simple problem but I can't see the solution anywhere >> > >> >My Xml file has a node with a character of Ascii 1 (the >test file is >> >below) Xerces will fail to parse this I have tried with Xerces 2.1 >> >DOM, and Xerces 2.2 Sax and both fail >> > >> >I debugged the DOM version (since that was where I hit the problem >> >first) it gives me 'XMLErrs::InvalidCharacter' inside >> >'XMLScanner::scanCharData' >> >or 'XMLErrs::InvalidCharacterRef' inside >'XMLScanner::scanCharRef' if >> >it's escaped >> > >> >I can understand why since it has all control characters >(0-31 except >> >9, 10 and 13) flagged as invalid I need a way to read them though >> >since I am getting a machine generated string >> > >> >I assume there is a simple solution to this, presumably I need to >> >replace one of the default classes with a custom one?, but >I can see >> >where or how to do it >> > >> >can anyone give me some pointers on what I need to do? >> > >> > Thanks, Vin >> > >> >// My code is essentially the few lines below MemBufInputSource >> >inputSource((const XMLByte*)sDoc.c_str(), sDoc.size(), &ch); >> >XercesDOMParser domParser; domParser.parse(inputSource); >> > >> >(It doesn't matter whether the char is escaped or not so I have it >> >escaped here) <DALML> <V>1205,EX,FF,CAD</V> </DALML> >> > >> >>--------------------------------------------------------------------- >> >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] >> >> > >--------------------------------------------------------------------- >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]