我有下面的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