Skip to main content

XML Comments

XML comments are used to increase understanding of XML code.

XML comments are similar to HTML comments.

Syntax

A comment starts with <!-- and it ends with -->.

<!--This is a comment-->
note

Comments can't be nested one inside the other!

Fundamental Rules for Comments

  • Comments can't appear before XML declaration.
  • Comments may appear anywhere in a document.
  • Comments must not appear within attribute values.
  • Comments can't be nested inside the other comments.