XML Comments

tutorial and example
tutorial and example

XML comments are same as HTML comments. Comments are used as notes to easily understand the purpose of XML code.

Comment can be used to include related links, information and terms. They are visible only in the source code, not in XML code. Comment show up anywhere in XML code.

Syntax

Comment start with <!— and ends with —>. We can write comment in between these characters.

Example

Try Now

Comment Rules

  • It is not appear before XML declaration.
  • t may appear anywhere in a document.
  • Comments are not appear within attribute values.
  • Comments are not nested inside the other comments.