W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2000

Re: comment nodes

From: Joseph Kesselman/Watson/IBM <keshlam@us.ibm.com>
Date: Fri, 22 Sep 2000 16:33:05 -0400
To: www-dom@w3.org
Message-ID: <OF6F252889.F7612F43-ON85256962.006E39B3@pok.ibm.com>

>It's not the '>' that is the problem - it's the '--'
>(http://www.w3.org/TR/1998/REC-xml-19980210#sec-comments) says 'For
>compatibility, the string "--" (double-hyphen) must not occur within

Good point. But consider
     <!-- &#45;&#45;-->
... I'm honestly not sure when character references get processed, so I'm
not sure whether that comes through as written, as --, or gets caught as a
syntax error. I would be surprised if it's the latter.

The DOM made a deliberate decision not to enforce every possible
well-formedness constraint on every operation. String content, in general,
is something we do not check at this time. If you're concerned, either
refrain from producing ill-formed documents or check/fix them before using
them... or access the DOM through higher-level libraries that provide those
checks and repairs.

As noted, DOM Level 3 is expected to provide more assistance in finding
well-formedness problems, but will do so only when requested.

>BTW, are entity references resolved in comments?

I don't think so. Compare the grammar for comments [15] with the grammar
for AttValue [10] or content [43]. Comments don't make explicit provision
for references, and hence are just raw character strings.

Joe Kesselman  / IBM Research
Received on Friday, 22 September 2000 16:33:16 UTC

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