- XML comments are similar to HTML comments.
- It is used to make the codes more understandable for other developers to use.
- Comments not consider as a XML code.
- These comments add notes or lines for the purpose of better understanding the XML code.
- XML is known as self-describing data but sometimes XML comments are necessary.
- Comments begin with a <!-- and end with a -->
- XML Comments will ignored by the parser not to be validated.
An XML comment should be written as:
Read AlsoC# Comment
Example For Comments
Learn - XML tutorial - XML Comments - XML examples - XML programs
Rules for adding XML comments
- Doesn't use the comments before an XML declaration.
- We can use these comments anywhere in XML document except within attribute value.
- Don't nest the comments inside the other.