关于http访问sql server的问题
我在用http下用xml模板访问sql server,但得到的结果均是乱码,我看到有人说要加
<xsl:output encoding="gb2312"/>,但我却不知道加到哪里,有人知道吗?
<?xml version="1.0" encoding="gb2312" ?>
<root xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl="stylesheet.xsl">
<sql:header>
<sql:param name="col1">
010001
</sql:param>
</sql:header>
<sql:query>
select reg_name,reg_code from jhbj_register where reg_code=@col1 for xml auto
</sql:query>
</root>
xsl文件:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="*">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="jhbj_register">
<tr><td><xsl:value-of select="@reg_name" /></td>
<td><xsl:value-of select="@reg_code" /></td></tr>
</xsl:template>
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:apply-templates select="root" />
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>