Start with the first part of
this thread.
It basicly means,
do not parse anything inside this element as XML, treat the entire contents as text. The parent <script> element tells the parser to treat that text as script.
Now, you might think this means you can place CDATA anywhere in the document & prevent parsing, for things like displaying source code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Title</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel='stylesheet' type='text/css' href='style.css' />
</head>
<body>
<p> ... Content ... </p>
<pre><code><![CDATA[
This should be <b>unparsable</b> content;
which displays as-is.
]]></code></pre>
</body>
</html>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Title</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <link rel='stylesheet' type='text/css' href='style.css' />
- </head>
- <body>
- <p> ... Content ... </p>
- <pre><code><![CDATA[
- This should be <b>unparsable</b> content;
- which displays as-is.
- ]]></code></pre>
- </body>
- </html>
However, that's not the case. Opera is the only browser I know of that will display that <code> line as-is. Firefox will throw the contents away & IE will parse it without the <b> and show a broken HTML element on the end.
Strong with this one, the sudo is.