Subject: Re: [xsl] Strings Comparison Question. From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 16 Jan 2003 13:51:39 -0500 |
1. Is it possible to compare two strings lexicographically in XSL/XPATH? I believe the answer is no. Is there a way I can achieve this?
2. I have listed the XML & XSL below. In that the community name attribute could start with a alphabet, a number or any other character. Most of the community names are expected to start with alphabets. In my output, if I have one or more community name starting with a certain alphabet (i.e. 'A') then I want to put a link (aka advance orgranizer) at the top of the page that would say 'A' and likewise for all the alphabets. Also since I have few communities starting with non-alphabets, I would want to put a link called Miscellaneous that would link to a page which would display all non-alphabetic characters.
How would I go about doing this? And the those non-alphabetic characters are not fixed, they could vary depending on the XML file used. If there was string comparison allowed then I could do something like @name<'a' or @name>'z' for each node and that would give me all non-alphabetic characters.
<xsl:if test="starts-with(@name,'*')"> <xsl:call-template name="createTopLetterLinkForCommunity"> <xsl:with-param name="letterLink">*</xsl:with-param> </xsl:call-template> </xsl:if>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Strings Comparison Questi, Michael Kay | Thread | Re: [xsl] Strings Comparison Quest, Dimitre Novatchev |
Re: [xsl] how to "save" a context?, Joerg Heinicke | Date | [xsl] Nested XML Tree View, Ben Graham |
Month |