Project

Profile

Help

Bug #2557 » testmap.xslt

Pieter Masereeuw, 2015-12-22 08:47

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.0">
<xsl:template match="/">
<xsl:variable name="map" select="map { 'beast' : xs:integer(666) }"/>
<xsl:variable name="xpath1" select="'666 + 1'"/>
<xsl:variable name="xpath2" select="'$beast + 1'"/>
<xsl:message select="concat('Checking key beast in map, beast=', map:get($map, 'beast'))"/>
<xsl:message select="concat('Adding one to key beast, result is ', map:get($map, 'beast') + 1)"/>
<xsl:message>evaluating $xpath1: <xsl:evaluate xpath="$xpath1"/></xsl:message>
<xsl:message>evaluating $xpath2: <xsl:evaluate xpath="$xpath2" with-params="$map"/></xsl:message>
</xsl:template>
</xsl:stylesheet>
(2-2/2)