You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Michael Mason <mg...@decisionsoft.com> on 2000/07/13 10:28:34 UTC

Re: Xerces C++ Dev - XML - Apache Re DoEscapes.html

Henrik Vind wrote:
> 
> Dear Mike,
> 
> I've had the concern regarding performance now confirmed having found and
> read your positing.
> Do you know of a remedy except setting doEscapes = false which allows me to
> work with <, >, &, etc, and to do it fast !?

Basically, if you want to output XML you need to check for those
characters and expand them. If you don't, you could end up outputting
fragments like

<foo> My maths expression is 3 < 4 </foo>

which is not valid XML, since the < must be escaped as &lt;. If you can
guarantee that your content will not contain special characters such as
these, then you can turn off the escaping. One possible way to do this
would be to do some kind of pre and post filtering on your content, but
this may end up taking as long as the escape checking in the first
place!

Mike.

> > Hi,
> > In the DomPrint example there is a command line option
> > -NoEscape
> >
> > What exactly does this do ?
> > Can someone give me an example of what will be different if set this
> > option ?
> 
> If escaping is turned on, output of characters like & and < will be
> replaced by &amp; and &lt; etc. Turning on escaping also slows the thing
> down *lots*, though. The DOMPrint C++ output code (overloads of <<,
> mainly) shows how this escaping works.
> 
> Mike.