- From: Stybnar, Michal <Michal.Stybnar@siemens.com>
- Date: Wed, 03 Nov 2010 10:35:21 +0000
- To: <site-comments@w3.org>
- Message-Id: <D1FEF394316C194395A2DA59959486E7072651E4@skbtss105a.ww300.siemens.net>
Hello, 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 generation). 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): <!ELEMENT FOO (BAR)* -- 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. SDE-SK SVI CC PVF BSW 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