- Q:Xsl支持调用外部语言
- A:例:使用xalan.jar的函数
xmlns:xalan="http://xml.apache.org/xalan/
xalan:org.apache.xalan.lib.ExsltDatetime.year()
<ele1 attr1="111"><ele1>
<ele1><attr1>111</attr1></ele1>
<?xml version="1.0" encoding="GBK"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="GBK" omit-xml-declaration="no"/>
<xsl:template name="convert">
<xsl:param name="node"/>
<xsl:for-each select="$node">
<xsl:copy>
<xsl:for-each select="./@*">
<xsl:element name="{name()}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
<xsl:call-template name="convert">
<xsl:with-param name="node" select="*"/>
</xsl:call-template>
</xsl:copy>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>