Comments allow XML developers to enter plain-language explanations or remarks about the contents of the document. Just as in VBA, where the single quote signifies a comment, XML has its own syntax to denote a comment. Comments in XML begin with the <!-- characters and end with the --> characters, as follows:
<!--Document created by Mike Alexander-->
Comments are also useful when you want to disable a particular construct or processing instruction in the XML document. For instance, imagine your XML document contained a processing instruction that forced the document to open with Excel. You may want to disable this processing instruction so the document opens in Internet Explorer by default. Instead of removing the processing instruction, you can simply comment it out by wrapping it in a comment as shown here:
<!-- <?mso-application progid="Excel.Sheet"?> -->
Was this article helpful?