RE: [xsl] get value from link from last slash

Subject: RE: [xsl] get value from link from last slash
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 14 Nov 2007 08:32:07 -0000
In 1.0 you need a recursive template to do this. The logic is

template name="last-part"
  if contains($in, '/')
  then call-template last-part (with-param $in = substring-after($in, '/'))
  else $in

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Vaduvoiu Tiberiu [mailto:vaduvoiutibi@xxxxxxxxx] 
> Sent: 14 November 2007 07:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] get value from link from last slash
> 
> Hi, I have a little wierd problem. i have an xml where I have 
> a bunch of image links like:
> 
> root/statics/images/image.jpg
> root/images2/image2.jpg
> 
> is there a way to extract the names of the images using xslt 
> 1.0? I need to extract the names of the images...image.jpg, 
> image2.jp, etc. I thought about using substring but there are 
> more than a slash in the path. Basically I would need the 
> string from the last slash to the end. Sounds a little 
> complicated but is there a way around it? 10x
> 
> 
> 
> 
>       
> ______________________________________________________________
> ______________________
> Get easy, one-click access to your favorites. 
> Make Yahoo! your homepage.
> http://www.yahoo.com/r/hs 

Current Thread