Comments are an XML construct, and are normally only valid inside a DTD. However, as 節 7.4, “Escaping Back to XML” shows, it is possible to use XML syntax within the document.
The delimiter for XML comments is the string
“--
”. The first occurrence of
this string opens a comment, and the second closes it.
<!-- This is inside the comment -->
<!-- This is another comment -->
<!-- This is one way
of doing multiline comments -->
<!-- This is another way of --
-- doing multiline comments -->
XHTML users may be familiar with different
rules for comments. In particular, it is often believed that
the string <!--
opens a comment, and it is
only closed by -->
.
This is not correct. Many web browsers have broken XHTML parsers, and will accept incorrect input as valid. However, the XML parsers used by the Documentation Project are more strict, and will reject documents with that error.
<!-- This is in the comment --
THIS IS OUTSIDE THE COMMENT!
-- back inside the comment -->
The XML parser will treat this as though it were actually:
<!THIS IS OUTSIDE THE COMMENT>
That is not valid XML, and may give confusing error messages.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。