[xsl] comparing strings

Subject: [xsl] comparing strings
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 2 Jan 2001 10:28:29 +0100 (MET)
Dear friends,

happy new year to everybody!

Is there someone out there who can answer my simple question:
How to compare strings with XPath/XSLT, something like strcmp() in C
or compareTo() in Java?
I want a pure XSLT solution without using extensions.

For those of you who are interested I have a little use case:

Consider this simplified dictionary:

Question: given an arbitrary input term (e.g. as a parameter), how
can I display the next 10 terms, starting with my input or the
term which would follow directly in alphabetical order?

If I had numbers instead of strings, the following template would
solve the required task:

<xsl:param name="input" />

<xsl:template match="term">
   <xsl:if test=". >= $input and
                 not(preceding-sibling::term[10] >= $input)">
      <!-- display . in some appropriate way -->


|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread