summaryrefslogtreecommitdiff
path: root/tests/extensions/evaluate.xsl
blob: a58470f677a22eaa4ade4b7fb3ae40c536d862fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version='1.0'?>
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
  version='1.0'>

<xsl:variable name="expression" select="libxslt:expression('doc/two')"/>
  
  <xsl:template match="/">
    <xsl:variable name="string">doc/one</xsl:variable>
    <xsl:value-of select="libxslt:evaluate($string)"/>
    <xsl:value-of select="count(libxslt:evaluate('/doc/one')/../*)"/>
    <xsl:value-of select="libxslt:evaluate(/doc/three)"/>
    <xsl:value-of select="libxslt:eval($expression)"/>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="four">
    <xsl:variable name="string">doc/one</xsl:variable>
    <xsl:value-of select="libxslt:evaluate($string)"/>
    <xsl:value-of select="libxslt:eval($expression)"/>
  </xsl:template>
  
  <xsl:template match="text()"/>

</xsl:stylesheet>