Hi,

The SAX parser does not output XML. It outputs character strings. When
you write the text back to an XML file, you have to do XML escaping
again. That is not difficult, only a few characters must be escaped as
specified in the rec, see section 4.6.

You will be easier off by using an XML serializer. The TRAX interface
provides one: present your data as a SAXSource by letting your app
send the SAX events and request a StreamResult with an identity
transformation.

Regards, Simon

On Mon, Apr 11, 2005 at 02:41:37PM -0400, Puppala, Kumar (LNG-DAY) wrote:
> Thanks for your input. I think you are right. I cannot do this configuring
> something on the SAXParser. Rather I need to have the table mapping between
> ISO Latin-1 char set to XML character entities. Doing this, I will convert &
> back to &#amp; when I output my xml file. I am trying to find such a mapping
> table but am not able to find it. Does anyone know where I can find it?
> 
> Thanks,
> Kumar Puppala
> 
> 
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 11, 2005 2:15 PM
> To: [email protected]
> Subject: RE: XML Question
> 
> > -----Original Message-----
> > From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED]
> >
> <snip />
> > The problem is not so much the implicit conversion by the parser,
> > but rather the fact that the C++ app doesn't seem to take into
> > account that its output should be in full compliance with
> > the XML Rec. It seems to be outputting 'plain text that looks
> > very much like XML', but it isn't XML.
> 
> Hmm.. Maybe this needs some more explanation:
> 
> You have '&amp;' in your input that, when parsed and output as plain text,
> will yield a '&'. A compliant XML application --with XML as output--
> *ALWAYS* needs to yield '&amp;'.
> 
> Since a SAXParser is 100% XML compliant --well, should be--, an '&' *MAY*
> only be output as is, *IF AND ONLY IF* it is:
> - used in an entity (as the first boundary char)
> - in a CDATA section
> 
> All other appearances of a loose '&' should lead to:
> - an error (input)
> - '&amp;' (output)
> 
> I still don't think the SAXParser itself can be configured to do anything
> different...
> 
> HTH!
> 
> Greetz,
> 
> AD
> 
> 
> ---------------------------------------------------------------------
> 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]
> 

-- 
Simon Pepping
home page: http://www.leverkruid.nl


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

Reply via email to