7.5. 註解

An XML document may contain comments. They may appear anywhere as long as they are not inside tags. They are even allowed in some locations inside the DTD (e.g., between entity declarations).

XML comments start with the string <!-- and end with the string -->.

Here are some examples of valid XML comments:

範例 7.6. XML 通用註解
<!-- This is inside the comment -->

<!--This is another comment-->

<!-- This is how you
     write multiline comments -->

<p>A simple <!-- Comment inside an element's content --> paragraph.</p>

XML comments may contain any strings except --:

範例 7.7. 錯誤的XML 註解
<!-- This comment--is wrong -->

7.5.1. 待辦事項...

  1. Add some comments to example.xml, and check that the file still validates using xmllint.

  2. Add some invalid comments to example.xml, and see the error messages that xmllint gives when it encounters an invalid comment.

本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/

若有 FreeBSD 方面疑問,請先閱讀 FreeBSD 相關文件,如不能解決的話,再洽詢 <questions@FreeBSD.org>。

關於本文件的問題,請洽詢 <doc@FreeBSD.org>。