This won't work.  An illegal character is an illegal character, even if
it's represented as a numeric character reference.  Attempting to parse a
file with &#x1F results in the following error:

   Fatal Error at (file test1.xml, line 4, column 16): Invalid character
   reference

The only way to make this work is at the application level by encoding
illegal characters in something like Base64.

Dave



                                                                                       
                                               
                      Dean Roddey                                                      
                                               
                      <droddey@charmed         To:      [EMAIL PROTECTED]    
                                               
                      quark.com>               cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                          
                                               Subject: Re: I cannot find the answer 
after reading FAQ.                               
                      04/23/2002 09:48                                                 
                                               
                      PM                                                               
                                               
                      Please respond                                                   
                                               
                      to xerces-c-dev                                                  
                                               
                                                                                       
                                               
                                                                                       
                                               



They are inherently illegal in XML, so it doesn't matter what encoding you
use. Its not that they can't be represented in the source encoding, but
that
the parser won't accept them. You will have to escape them using character
refs, e.g:

    &#1F;

Unless my memory is failing me, this will work because the invalid char
checks are pre-entity expansion, though I could be wrong on that detail
since I've not tested it myself lately.

--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
[EMAIL PROTECTED]
http://www.charmedquark.com

"If it don't have a control port, don't buy it!"


----- Original Message -----
From: "Nathan Pitzer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 9:45 PM
Subject: I cannot find the answer after reading FAQ.


> We are attempting to store data in an XML file.  This data is encoded
ascii
> text, and because of this, some of the characters end up falling outside
the
> legal limits for XML characters.  Specifically, I am getting this error:
>
> Fatal Error at file "C:\natemail.xml", line 2, column 3275(4/23/2002
> 22:27:53):
> Invalid character (Unicode: 0x1F)
>
> The FAQ states that these are illegal values for XML, but it is unclear
> whether this is for UTF-8 specifically, or for all encodings.
>
> I have tried UTF-8, US-ASCII, and windows-1252 for encodings.
Additionally,
> I have played around with the XMLFormatter::EscapeFlags with no success
at
> getting the parser to accept the characters after writing the xml with
those
> settings.
>



---------------------------------------------------------------------
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