W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2007

Possible bug in the specification of createComment

From: Thomas Conway <conway@csse.unimelb.edu.au>
Date: Tue, 06 Nov 2007 08:51:35 +1100
To: www-dom@w3.org
Message-Id: <1194299495.24725.18.camel@wagner>

Hi All,

As a piece of routine testing using the Python 2.5 binding to DOM, I
tried the following:


The provided serializer toxml(), yields an XML document which is not
well formed. I.e. it contains the following:


Now this case is somewhat nastier than the createTextNode case, because
in the latter, the serializer can encode content using entity references
to avoid ill-formedness. Such an escaping mechanism is not obviously
possible in this case.

I've had some debate with Python guys as to where the bug lies. I see
the following possibilities:

1. It's simply a bug in my code, and the implementation is behaving
correctly in every respect. In this case the DOM specification should
include text warning about this case.

2. createComment should throw an exception if the text of the comment
contains the string "-->", which of course would require an amendment to
the specification.

3. The serializer (toxml, in this case) should throw an exception. As
far as I am aware, this would not require a change to the specification,
though it would be very helpful if a change was made to help
implementers get this right.

I look forward to discussing this further, and working out how to best
resolve this issue!

                                You are beautiful; but learn to work,
Dr Thomas Conway                      for you cannot eat your beauty.
conway@csse.unimelb.edu.au                      -- Congolese proverb
Received on Tuesday, 6 November 2007 16:25:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:13 UTC