func.function.3.xsl 583 B

1234567891011121314151617181920212223
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  3. xmlns:func = "http://exslt.org/functions" extension-element-prefixes="func">
  4. <!-- Test an EXSLT function with arguments -->
  5. <func:function name="func:initial">
  6. <xsl:param name="size"/>
  7. <func:result select="substring(.,1,$size)"/>
  8. </func:function>
  9. <xsl:template match="text()">
  10. <xsl:value-of select="func:initial(3)"/>
  11. </xsl:template>
  12. <xsl:template match="*">
  13. <xsl:copy>
  14. <xsl:apply-templates/>
  15. </xsl:copy>
  16. </xsl:template>
  17. </xsl:stylesheet>