我有下面的XML文件: -
<?xml version="1.0" encoding="UTF-8"?>
<directory>
<employee>
<name>Joe Smith</name>
<phone>4-0192</phone>
</employee>
<employee>
<name>Sally Jones</name>
<phone>4-2831</phone>
</employee>
</directory>
而下面的XSLT: -
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="directory">
<div>List of Employee<xsl:value-of select="@directory"/>
</div>
<br/>
<table>
<tr>
<td>Employee Name</td>
<td>Contact Details</td>
</tr>
<xsl:apply-templates select="employee"></xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="employee">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@phone"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
我想本地化XSLT文本:员工名单,员工姓名&联系方式XSLT本地化
如何本地化xslt文本?
您是否想要一次呈现所有可能文化的xml html文件,或者您是否只需要基于某种配置的其中一个? – 2011-05-15 07:39:25
我有许多xml和xslt文件....所以不能为每种文化创建多个xslt文件....所以我宁愿去替代解决方案,以便我不需要为每种文化创建多个文件.... – 2011-05-15 08:04:33
好问题,+1。查看我的答案,获取详细且高效的纯XSLT解决方案的链接。 – 2011-05-15 14:11:49