Is the code below valid XML?
<sometag
attribute1="value1"
<!-- attribute2="value2" -->
attribute3="value3">
</sometag>
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.
Questions like this are best answered by referring to the relevant specifications. In this case the Extended Markup Language (XML) 1.1 specification.
This says:
And the grammar for an element start tag is:
where the non-terminal symbols
SNameEqandAttValueare defined elsewhere. These 2 productions (and the others which I haven’t included here) do not allow theCommentnon-terminal symbol in this context.So that is a definitive NO.