【发布时间】:2011-08-23 13:14:10
【问题描述】:
我在 pre 标记内输出一些 C++ 时遇到问题。
我拥有的 XHTML 代码是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml" />
</head>
<body>
<pre><![CDATA[
#include <cstdio>
int x = 1;
]]></pre>
</body>
</html>
但是当我尝试查看网页时,我只看到了
int x = 1;
]]>
而不是
#include <cstdio>
int x = 1;
如我所愿。
我对 CDATA 的行为有什么不明白的地方?
【问题讨论】: