Re: [xsl] Get Document File name

Subject: Re: [xsl] Get Document File name
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Sun, 22 Oct 2006 16:43:33 -0500
Hi, Phil,

The usual answer to this is to pass the filename as a parameter to the transform. Here's the FAQ entry:

However, you could use some variety of string manipulation to get just the filename from the path.

The following transform does it:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="2.0" xmlns:xsl="";>

<xsl:output method="xml" version="1.0"/>

<xsl:template match="/">
<filename><xsl:value-of select="tokenize(document-uri(.), '/')[last()]"/></filename>


Jay Bryant
Bryant Communication Services

----- Original Message ----- From: "Philip Vallone" <philip.vallone@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Sunday, October 22, 2006 3:08 PM
Subject: [xsl] Get Document File name

Hi Everyone,

Is there a way to get the file name of the document you are processing? If I
use Document-uri() it returns the whole file path.



I would like to get:


Is this possible?


Current Thread