Project

Profile

Help

Bug #1744 ยป bug95.xsl

John Lumley, 2013-04-25 11:56

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xmlns:lay="http://jwlresearch.net/2012/layout"
exclude-result-prefixes="xs math"
version="3.0">
<xsl:template match="/">
<foo/>
</xsl:template>
<xsl:function use-when="true()" name="lay:XXX" as="element()*">
<xsl:param name="children" as="element()*"/>
<xsl:variable name="head" select="head($children)"></xsl:variable>
<xsl:variable name="offsets" as="xs:double*">
<xsl:iterate select="tail($children)">
<xsl:param name="first" select="$head"/>
<xsl:next-iteration>
<xsl:with-param name="first" select="."/>
</xsl:next-iteration>
</xsl:iterate>
</xsl:variable>
<xsl:for-each select="$offsets">
<foo/>
</xsl:for-each>
</xsl:function>
</xsl:stylesheet>
    (1-1/1)