Search code examples
xmltagsxhtmlcommentsuser-defined

Do xhtml or xml allow comments to be started by user defined tags?


Reusing old php-code and html-files I wanted to comment out large sections, but that's not too easily achievable, because those sections contain comments themselves already.

Looking at the helpfile for php and the 5.3 html syntax at w3 I found out, that comments have a very limited amount of tags one could use.

As I remember I have read years ago about some coding language which allows userdefined comment-tags, albeit they had to follow some rules.

Especially I wonder
- if userdefined comment-tags are possible in xhtml?
- if userdefined comment-tags are possible in xml?
- if it's possible in xhtml or xml, shouldn't it be possible in html, too, to define new comment-tags?


Solution

  • No.

    HTML comments (all versions, including HTML4, XHTML, and HTML5) and XML comments have always had the following form:

    <!-- This is a comment -->
    

    There are no "user-defined comment-tags" in HTML or XML.