如何在XML中注释一行? [英] How can I comment a single line in XML?

查看:474
本文介绍了如何在XML中注释一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这只是一个验证,不要错过.

This rather is a verification just not to miss out.

是否在XML中添加了行注释?因此,编译器使用的是"//"之类的不那么接近的东西.

Is/n't there a line-comment in XML? So, one without a closer, like "//" the compiler uses.

我看到了 如何操作我注释掉一块XML标签吗? 和其他一些讨论.

I saw How do I comment out a block of tags in XML? and several other discussions.

这种注释将一行注释掉而又不打扰它附近的行将很实用.

This type of comment would be practical to comment out a line without bothering its closer somewhere down.

推荐答案

否,无法用XML注释行,并且注释不能在换行符处自动结束.

No, there is no way to comment a line in XML and have the comment end automatically on a linebreak.

XML仅具有一个注释定义:

XML has only one definition for a comment:

'<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

XML禁止在注释中使用--来保持与SGML的兼容性.

XML forbids -- in comments to maintain compatibility with SGML.

这篇关于如何在XML中注释一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆