W3C home > Mailing lists > Public > site-comments@w3.org > November 2010

Bug in XML specification

From: Stybnar, Michal <Michal.Stybnar@siemens.com>
Date: Wed, 03 Nov 2010 10:35:21 +0000
Message-Id: <D1FEF394316C194395A2DA59959486E7072651E4@skbtss105a.ww300.siemens.net>
To: <site-comments@w3.org>

I have found a problem in the specification, which can make usage of  
XML more confusing and
in some cases virtually unusable (e.g. when using automatic XML  

There's a bug in the XML specification forbidding double hyphen inside  
of commentaries which
is causing unnecessary confusion about XML. The begin of comment is  
always <!-- and the
closing of comment is always -->. In this way the double hyphen is  
absolutely correct inside
of comments as well as any other character (possibly only characters  
defined in the current
encoding)! There's written in the source#1, that double hyphen is  
forbidden to stay compatible
with SGML, but look at the following:

In SGML this is correct, but not in XML (used in DOCTYPE):
     -- an element FOO that takes any no of
        element BAR as its content --
Therefore the compatibility with SGML is not met and double hyphen  
("--") may be used in XML's
comments without restrictions. Double hyphen will never create a  
comment in XML - at least it's
not coded in any known (at least for me) XML parsers. I tried at least  
Mozilla, Internet Explorer,
TinyXML and XML Tools from Notepad++. By the way TinyXML does not  
forbid double hyphen
inside of commentaries and everything works as expected.
Source: 1) http://www.w3.org/TR/2008/REC-xml-20081126/#sec-comments     
-> bug in the specification
             2) http://lists.w3.org/Archives/Public/www-html/2002Apr/0060.html 
      -> discussion about SGML

S pozdravom (Mit freundlichen Gruessen / kind regards)

Michal Stybnar
IT Developer
Siemens Program and System Engineering s.r.o.
Westend Court, Dubravska cesta 4
845 37 Bratislava, Slovakia
Tel: +421 (2) 5968 4712
SIEMENS E-mail: Michal.Stybnar@siemens.com
Internet: http://www.siemens-pse.sk

Received on Wednesday, 3 November 2010 11:34:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:15:42 UTC