With my conventional programming background, I want to define a $maxeffdt
variable BEFORE I call the template below and this do some kind of <xsl:if
test="EFFDT = $maxeffdt> but I'm not sure this is doable/appropriate in the
new XSLT world.
You have two options if $maxeffdt is a global parameter
set by
<xsl:param name="maxeffdt"/>
at the top level of your stylesheet and passed in (in a system-dependant
manner) when you start the program then it's globally available and you
can reference it directly in your template.
If it is set within the template (eg if it is a value from some other
element in the source document) then it;s a local parameter so you need
to declare it in this template and pass it in.
<xsl:template match="VENDOR_LOC">
<xsl:param name="maxeffdt"/>
then call it as
<xsl:apply-templates select="VENDOR_LOC">
<xsl:with-param name="maxeffdt" select="....something
Once you have your two dates the problem is comparing them. XSLT1
doesn't have string or date comparison operators (XSLT2 will have both)
so the easiest thing is to get rid of the - and compare as numbers
<xsl:if test="translate($maxeffdt,'-','') < translate(EFFDT,'-','')">
...
so this compares 2006-01-26 against 1901-01-01 by comparing
20060126 19010101
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--