XML Comments

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

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


<?xml version="1.0"?>  
<!----Employee salary uploaded by months--->  
        < salary >50000</salary>  
        < salary >35000</salary>  
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.