[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Searching for specific character in string and outputting first 4 digits that follow


Subject: [xsl] Searching for specific character in string and outputting first 4 digits that follow
From: Sharon_Harris@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 9 Sep 2008 08:12:26 -0400

I am trying to figure out how to search for the 2nd instance of a character
in a string and then output only the first 4 digits that follow this
character. For the PubDate element, I want to find the 2nd instance of the
back slash ("/") and then output the 4-digit year that follows this back
slash. In the following example, I want to output "2008'.

   <PubDate>5/12/2008 3:13:14 PM</PubDate>

I want to output the year so it displays in paragraph hardcoded into the
stylesheet. For example,

   <p>)<PubDate Year><xsl:text>&#160;TheAxsl-list@xxxxxxxxxxxxxxxxxxxxxxxx
   Group, Inc.</xsl:text></p>

I know something like this can be achieved using <xsl:value-of
select="PubDate"> but don't know the logic/argument to pass to search the
back slash and output the year that follows it.

Thanks for your help!
_______________________________
Sharon Goldner Harris
Knowledge Management Evangelist
Ultimate Software Group
704-660-6482

Confidentiality Note: This e-mail message and any attachments to it are
intended only for the named recipients and may contain legally privileged
and/or confidential information. If you are not one of the intended
recipients, do not duplicate or forward this e-mail message.


Current Thread