Project

Profile

Help

Download (1.61 KB) Statistics
| Branch: | Revision:

he / src / main / c / samples / cppTests / testExtension.xsl @ d0e6f8be

1 72bf04c6 Norman Walsh
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2
xmlns:saxon="http://saxon.sf.net/"
3
xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
xmlns:f="http://www.saxonica.com/myfunction"
5
     version="3.0">
6
<!--<xsl:import-schema schema-location="schema_1.xsd" />-->
7
        <xsl:param name="numParam" select="2" />
8
  <xsl:param name="testdoc">
9
    <testdoc name="attr-data">testdoc-data</testdoc>
10
  </xsl:param>
11
	<xsl:output method="xml" indent="yes" />
12
13
<xsl:function name="f:is-licensed-EE" as="xs:boolean">
14
  <xsl:variable name="v" select="system-property('xsl:product-version')"/>
15
  <xsl:sequence select="starts-with($v, 'EE') and not(contains($v, '(unlicensed)'))"/>
16
</xsl:function>
17
18
19
  <xsl:template match="*">
20
	<output>
21
	<b>Is licensed=<xsl:value-of select="f:is-licensed-EE()"/></b>
22
 	<xsl:variable name="args" select="['param1-data', .]"/>
23
	<xsl:variable name="phpCall" select="saxon:native('userFunction', $args)" />
24
	<extension-function-test>Call to saxon:php-call:
25
           <xsl:if test="not(empty($phpCall))">
26
		Result from phpCall:
27
                <xsl:value-of select="$phpCall" /> 
28
            </xsl:if>
29
	    <xsl:if test="empty($phpCall)">
30
		Empty result FOUND:
31
                <xsl:value-of select="$phpCall" /> 
32
            </xsl:if>
33
</extension-function-test> 
34
	<!--<xsl:value-of select="normalize-unicode('Eisbär', 'NFKD')" />-->
35
    <xsl:for-each select="person" >
36
	<out><xsl:value-of select="."/></out>
37
    </xsl:for-each>
38
      <out><xsl:value-of select="$numParam*2"/></out>
39
    </output>
40
	<xsl:message>Testing message1</xsl:message>
41
	<xsl:message>Testing message2</xsl:message>
42
  </xsl:template>
43
44
</xsl:stylesheet>