You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/07/25 18:48:06 UTC
DO NOT REPLY [Bug 14236] -
EXSLT function unbinds params
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14236>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14236
EXSLT function unbinds params
foxyshadis@hotmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|EXSLT function changes |EXSLT function unbinds
|variables |params
Version|2.4 |CurrentCVS
------- Additional Comments From foxyshadis@hotmail.com 2003-07-25 16:48 -------
Not sure if you ever did add testcases, but I just hit the bug again. String
index out of range: 0. Assigning the param to a temp. variable inside the
functions and using that fixes it, again.
XML
----
<?xml version="1.0" encoding="ISO-8859-1"?>
<keys><entries>
<entry date="2003-07-25"/>
</entries>
</keys>
XSL
----
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:func="http://exslt.org/functions"
xmlns:dt="http://exslt.org/dates-and-times"
exclude-result-prefixes="dt func xj"
xmlns:xj="http://foxyshadis.dyndns.org/journal"
>
<xsl:variable name="year" select="2003"/>
<xsl:variable name="month" select="7"/>
<xsl:variable name="day" select="25"/>
<xsl:template match="/">
<xsl:copy-of select="//entry[xj:good_day(@date)]"/>
</xsl:template>
<func:function name="xj:good_day">
<xsl:param name="date"/>
<func:result select="dt:day-in-month(dt:date($date))=$day and
xj:good_month($date)"/>
</func:function>
<func:function name="xj:good_month">
<xsl:param name="date"/>
<func:result select="dt:month-in-year(dt:date($date))+1=$month and
xj:good_year($date)"/>
</func:function>
<func:function name="xj:good_year">
<xsl:param name="date"/>
<func:result select="dt:year(dt:date($date))=$year"/>
</func:function>
</xsl:stylesheet>