<p>I need to be able to find the last occurrence of a character within an element.</p>

<p>For example:</p>

<pre><code>&lt;mediaurl&gt;http://www.blah.com/path/to/file/media.jpg&lt;/mediaurl&gt;
</code></pre>

<p>If I try to locate it through using <code>substring-before(mediaurl, '.')</code> and <code>substring-after(mediaurl, '.')</code> then it will, of course, match on the first dot.  </p>

<p>How would I get the file extension?  Essentially, I need to get the file name and the extension from a path like this, but I am quite stumped as to how to do it using XSLT.</p>

How about tokenize with "/" and take the last element from the array ?
```
```
Example: tokenize("XPath is fun", "\s+")
Result: ("XPath", "is", "fun")
```
```
Was an XSLT fiddler sometime back... lost touch now. But HTH