How do I comment out an XML section that has comments inside?
The following won’t work. It only comments out stuff0:
<!--
stuff0
<!-- stuff1 -->
stuff2
<!-- stuff3 -->
stuff4
<!-- stuff5 -->
stuff6
-->
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
--is not allowed in XML comments. You can add a space between the two-. If you want to do that programmatically, an XSLT may do the job for you. For example, the following XSLT:Gives the following output:
But the XSLT processor may also output an error. Given the specification, it’s up to the implementation to add a space or raise an error.