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

[xsl] substring


Subject: [xsl] substring
From: dan@xxxxxxxxxxxxx
Date: Tue, 10 Jan 2006 07:42:22 -0500 (EST)

I would like to use substring-after on an element, but cannot figure out
the syntax. Here is the xml:

<key>Location</key>
<string>file://localhost/E:/Rap/2%20Pac/Greatest%20Hits%20Disc%201/03-Temptations.mp3</string>

Here is the xsl:

<location>
<xsl:value-of select="substring-after(child::*[preceding-sibling::* =
'Location'], 'file://localhost/'" />
</location>

I would like the end result to be:
<location>
E:/Rap/2%20Pac/Greatest%20Hits%20Disc%201/03-Temptations.mp3
</location>

This part - child::*[preceding-sibling::* = 'Location'] works well to grab
the <string> of out <key>Location</key>. It is the substring-after part
that I am having problems with.

Any help would be greatly appreciated.

Thanks,
Dan


Current Thread