| |
---|
| | @offset: Output the year +/- some integer value. The input value is truncated and defaults to zero if not supplied. |
---|
| | --> |
---|
| | <template name="PaperYear" match="PaperYear"> |
---|
| | <common> |
---|
| | <xsl:variable name="add"> |
---|
| | <xsl:value-of select="floor(@offset)" /> |
---|
| | <xsl:if test="not(@offset)">0</xsl:if> |
---|
| | <xsl:variable name="add" as="xs:integer"> |
---|
| | <xsl:value-of select="if ( @offset ) then floor( @offset ) else 0" /> |
---|
| | </xsl:variable> |
---|
| | <xsl:value-of select="$paper-year + $add" /> |
---|
| | <!-- |
---|
| | It appears that we need an explicit type cast for $paper-year to keep everyone happy?!?! Even if you declare $paper-year to be xs:integer, XML Exchanger Editor still thinks you can't add a string ($paper-year) to an integer ($add). Stupid. |
---|
| | --> |
---|
| | <xsl:value-of select="xs:integer( $paper-year ) + $add" /> |
---|
| | </common> |
---|
| | </template> |
---|
| | |
---|
| | <template name="PaperYear-strip" match="PaperYear" mode="strip"> |
---|
| |
---|
|