为什么输出的HTML会加上
cxghj 2004-03-11 10:03:41 XML文件:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="Error.xsl"?>
<TEST VERSION="1.0">
<ERROR_INFO >错误的用户名或密码!</ERROR_INFO>
</TEST>
XSL文件:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="GB2312" />
<xsl:template match="/">
<html>
<head>
<title>错误</title>
</head>
<body>
<xsl:value-of select="TEST/ERROR_INFO" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
解析后的HTML文件:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>错误</title>
</head>
<body>错误的用户名或密码!</body>
</html>
为什么解析后的HTML文件中会有
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
如果我在XSL文件中加上
<META http-equiv="Content-Type" content="text/html; charset=GB2312">
则输出的文件中会有
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<META http-equiv="Content-Type" content="text/html; charset=GB2312">
这两行
如何不输出
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">