Re: [xml] comment syntax

On Fri, 2007-05-01 at 19:26 -0500, Mike - EMAIL IGNORED wrote:
I see:
   Comments may appear anywhere in a document
   outside other markup; ...


      <!--Here is my special tag-->
         stuff in tag

Now is a sense, the comment is within markup, being between
the two MyDoc tags.  I assume that this is NOT what they mean,
and that the comment is ok.  Right?

Right.  The prohibition is intended to exclude things like
<MyDoc -- this would be an SGML comment but is illegal in XML -->
<!ELEMENT a --* represent the attick of an old house --

also legal in SGML but not allowed in XML.

At one point we had <!--* . . . . *--> as an XML comment,
with the asterisks required, but people felt it to be
too verbose.  If we had done this, we could have allowed
"--" inside a comment (with a small change to SGML that
was in fact possible) but as things stand, an XML
comment can't contain "--" at all.

Basically, you can put a comment wherever you can
put an element or (in a DTD or the internal
document type declaration subset) an <!ELEMENT...> declaration.
Do not put a comment before the XML declaration, though,


Liam Quin - XML Activity Lead, W3C,
Pictures from old books:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]