I have a source file with content as following:

============= the source file content =================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
  <head>
    <title>DOM Tree Testing</title>
<script>
//<!--
function test2() {
  var a="<this is a test>";
  return;
}
//-->
</script>
</head>
<body>
</body>
</html>
============= the source file content =================

I used a HTML parser to parse the source, constructed a DOM using 
xerces1.4.0, and serialized it to a dest file using XHTMLSerializer.
The content of <script> is constructed as TextNode.

However, the <script> part is serialized as following. 

============= the dest <script> content =================
<script language="javascript"><![CDATA[
//<!--
function test2() {
  var a="<this is a test>";
  return;
}
//-->
]]></script>
============= the dest <script> content =================
Please note the
"<![CDATA[" and "]]" right after <script> and before </script>.

Is this expected behaviour? HTMLSerializer does output a
valid HTML file. If XHTML is intented for "correcting" lousy
html, isn't it resonable to output a valid html?

Thanks,
Zhaohua Meng

Hotlens.com Inc.
http://www.hotlens.com

350 Fifth AVE
Suite 3113
New York, NY 10118
Phone: 212-465-1700
Fax: � 212-465-1710
email: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to