[XML-SIG] Unwanted behavior in PrettyPrint: > doesn't round-trip

Morten Liebach m at mongers.org
Wed Jul 7 11:03:06 CEST 2004

On 2004-07-06 13:16:47 -0600, Mike Brown wrote:
> rmunn at pobox.com wrote:
> > <?xml version='1.0' encoding='UTF-8'?>
> > <description>This contains a nested &lt;b> tag</description>
> > >>> 
> > 
> > I'd prefer the output to be:
> > """<?xml version='1.0' encoding='UTF-8'?>
> > <description>This contains a nested &lt;b&gt; tag</description>
> > """
> > 
> > This XML data is eventually going to be going into an HTML page and sent
> > to the user's browser. Since the > character doesn't close any tags,
> > most browsers will probably display it. But with the vast number of
> > different browsers out there, with slightly different behavior, I'd
> > rather not rely on "probably". :-( I'd prefer for the &gt; entity to
> > make it through a round trip (parse to print) untouched.
> There are no browsers that will have a problem with an unescaped ">".
> This is one of those situations where paranoia about web browser behavior is 
> not supported by reality, much like when people freak out about putting 
> "&amp;" in an href.

Probably true in this case, as the output, judging from the example, is
going to be valid XML or XHTML of some sort.

If the output is not valid and the browser spot this it goes into
tagsoup parsing mode, and nobody know what that means, it's not defined
by any standards or docs.  Then it might help to escape '>', otherwise

Have a nice day

http://m.mongers.org/ -- http://gallery.zentience.org/

More information about the XML-SIG mailing list