Project

Profile

Help

Bug #2567 ยป Iteration_Null_pointer_error.xsl

David Rudel, 2015-12-31 13:19

 
<?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"
exclude-result-prefixes="xs"
version="3.0">
<xsl:template match="/">
<xsl:variable name="last.day" select="day[last()]"/>
<xsl:variable name="completion.day" as="element()">
<xsl:iterate select="day">
<xsl:on-completion>
<xsl:sequence select="$last.day"/>
</xsl:on-completion>
<xsl:choose>
<xsl:when test="@complete eq 'yes'">
<xsl:break>
<xsl:sequence select ="."/>
</xsl:break>
</xsl:when>
</xsl:choose>
</xsl:iterate>
</xsl:variable>
<xsl:copy-of select="$completion.day"/>
</xsl:template>
</xsl:stylesheet>
    (1-1/1)