XML 文件中是否允许嵌套注释?
<!-- Making only one observation attempting to correct the error code -->
<!-- <component>
<!-- Result observation template -->
<!-- <id root="2.16.840.1.113883.19.5.10" extension="103220"/>
</component> -->
最佳答案
不可以,字符串 --
不允许出现在 XML 的注释中。所以你有 --
出现在另一个评论中的事实将导致失败。
并且尝试发布该答案也破坏了文本条目解析;)
要进一步证明,请查看 W3C 规范:
http://www.w3.org/TR/2008/REC-xml-20081126/#sec-comments
短语
For compatibility, the string " -- " (double-hyphen) MUST NOT occur within comments.]
出现在 XML 注释部分的第一段中。
关于xml - XML 中的嵌套注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1324821/