
1. xsl文件:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
//这里虽然指明了显示编码,但是xmlspy生成的xsl解释文件会另在此行之前加上utf-16的编码方式而另此处的指示无效,解决办法如下:
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/></head>
2.xsl解释xml文件后输出文件的源代码:
<html>
<head>
<META http-equiv="Content-Type" content="text/htmlcharset=UTF-16">
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
</head>
<body bgcolor="#0099ff">
3. 解决办法:把xsl文件改写成如下形式
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/>
<head>
<META http-equiv="Content-Type" content="
使用xmlspy编写xsl文件时候,当使用如下编码时,在xsl解释xml文件的时候总是使用UTF-16编码方式:
1. xsl文件:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
//这里虽然指明了显示编码,但是xmlspy生成的xsl解释文件会另在此行之前加上utf-16的编码方式而另此处的指示无效,解决办法如下:
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/></head>
2.xsl解释xml文件后输出文件的源代码:
<html>
<head>
<META http-equiv="Content-Type" content="text/htmlcharset=UTF-16">
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
</head>
<body bgcolor="#0099ff">
3. 解决办法:把xsl文件改写成如下形式
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/>
<head>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/>
</head>
<body bgcolor="#0099ff">
在<head></head>之前加上<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/>,这样xsl解释xml文件生成的文件的源代码就会是如下形式:
<html>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<head>
<META http-equiv="Content-Type" content="text/htmlcharset=UTF-16">
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
</head>
<body bgcolor="#0099ff">
这样编码方式就在utf-16之前给改过来了,客户端也可以正常显示gb2312的中文了。
text/htmlcharset=gb2312"/>
</head>
<body bgcolor="#0099ff">
在<head></head>之前加上<META http-equiv="Content-Type" content="text/htmlcharset=gb2312"/>,这样xsl解释xml文件生成的文件的源代码就会是如下形式:
<html>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<head>
<META http-equiv="Content-Type" content="text/htmlcharset=UTF-16">
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
</head>
<body bgcolor="#0099ff">
这样编码方式就在utf-16之前给改过来了,客户端也可以正常显示gb2312的中文了。
XML Document打开应该是显示“<?xml version="1.0" encoding="UTF-8"?>”吧?你可以看看“Extensible Markup Language”这个选项。
xml文件即可扩展标记语言。有的表格采用此种格式,不方便打开,但是有一种方法可以快速打开该文件,即使用EXCEL快速打开XML文件。 工具/原料 EXCEL 2010 方法/步骤 首先,运行EXCEL 2010,出现一个空白工作簿, 将XML文件拖进CEL 2010,即可快速欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)