[XML-SIG] XML 0.5.1 bug: 'amp' character reference not handled correctly by "HtmlBuilder/HtmlWriter"

Dieter Maurer dieter@handshake.de
Fri, 13 Aug 1999 18:59:35 +0200 (CEST)


Fred L. Drake, Jr. writes:
 > Dieter Maurer writes:
 >  > "HtmlBuilder" translates '&' into an entity reference.
 >  > This does not follow the DOM spec. It specifies that
 >  > character references are expected to be expanded by the
 >  > HTML/XML processor.
 >  > 
 >  > "XmlWriter/HtmlWriter" does not output the 'amp' entity reference.
 >  > This, obviously, is a bug in "XmlWriter/HtmlWriter".
 > 
 >   No, but if & is present as data, it writes out &, so I think
 > that's OK.
I do not think, it is correct.
HTML input files should contain '&' rather than '&', because
'&' may yield invalid HTML code.
"HtmlBuilder" translates "&" into something "HtmlWriter"
ignores. I think, this is a bug.

 >  > By the way, processing instructions are not output, too.
 > 
 >   You you sure they're in your tree?  What I see is that they are
 > output, but using the XML-style syntax: <?foo bar?> instead of
 > <?foo bar>.
In fact, I did not test it at all -- sorry!
I looked at the sources and did not see a definition for
Entity and Processing Instruction output.
Private mail with Dierk Hoeppner suggests that some magic
in XMLWriter processes entity references.
You now tell me that processing instructions are
magically processed.

Seems, that I must have a closer look at this code.

By the way, my copy of "write.py" (from the distribution tar)
has an empty "XmlWriter.doOtherNode".

Thank you for your comment
- Dieter