[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Finding the path from the filename

Subject: RE: Finding the path from the filename
From: "bryan" <bry@xxxxxxxxxx>
Date: Mon, 20 Jan 2003 16:49:18 +0100
xsl crop
You can also use substring-after.

I'm pretty sure this is a faq, anyway it's one of those things that I've
got the bad habit of writing anew as I need it rather than just going to
get it from some place I've got it and copying, so there's always some
sort of error likely to crop in without testing, you may have to
rearrange some parts after testing on your own.

<xsl:param name="filepathANDname"/>
<xsl:variable name="filename">
<xsl:call-template name="filenamegetter"><xsl:with-param
name="thisPathANDname" select="$filepathANDname"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="filepath"><xsl:value-of
select="substring-before($filepathANDname,$filename)"/></xsl:variable>


<xsl:template name="filenamegetter">
<xsl:param name="thisPathANDname"/>
<xsl:variable name="afterthisPathANDname"
select="substring-after($thisPathANDname,'\')"/>
<xsl:choose><xsl:when test="contains($thisPathANDname,'\')">
<xsl:call-template name="filenamegetter"><xsl:with-param
name="thisPathANDname"
select="$afterthisPathANDname"/></xsl:call-template>
</xsl:when><xsl:otherwise><xsl:value-of select="$thisPathANDname
"/></xsl:otherwise></xsl:choose>

</xsl:template>

note that Cams example with lastCharPosition could be used to make this
process much more generic.

Note that I would not say this is a 100% secure method but close enough
not to be easily discernable from the 100% secure.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.