You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Puppala, Kumar (LNG-DAY)" <ku...@lexisnexis.com> on 2005/04/11 19:45:31 UTC

XML Question

This question is not strictly FOP based but I guess someone here might be
able to help me. I am using SAXParser to parse my xml file to a .fo file
using a C++ application. The parser implicitly converts &#amp; to &. Hence
when I send the .fo file (containing & in the data), FOP renderer throws an
exception since it parses the document as well and does not like & in the
data. I don't want my SAXParser to do these implicit conversions. Is there
any option I can use to turn off this conversion when I initialize my
SAXParser?

 

Thanks,

Kumar Puppala 


RE: XML Question

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
>
<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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: XML Question

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Puppala, Kumar (LNG-DAY) [mailto:kumar.puppala@lexisnexis.com]

Hi,

> This question is not strictly FOP based but I guess someone
> here might be able to help me.
> I am using SAXParser to parse my xml file to a .fo file
> using a C++ application. The parser implicitly converts
> &#amp; to &.

So the output is no longer valid XML...
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.

I'm not sure if this type of problem can be solved by configuring the SAX
Parser (?)


Greetz,

AD


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org