dynamic URL
Posted: Wed Jun 15, 2005 6:03 pm
Hi, I'm having a bit of an issue here... Basically, what I want to do is to dynamically generate the path where my output files will be created.
I have the following xml file :
What I tried to do is to create a variable with the correct hierarchy (in that case : "/dir1/dir2/dir3") using concat() inside a for-each tag, but the result is a local variable. What I need is a global variable so I can use it to determine where my output files will go.
Any help would be greatly appreciated.
I have the following xml file :
Code: Select all
...
<file>
<filename name abv="dir1">Directory 1</name >
<file>
<filename abv="dir2">Directory 2</name >
<file>
<filename abv="dir3">Directory 3</name >
</file>
</file>
</file>
...
Code: Select all
...
<xsl:for-each select="//file">
<xsl:variable name="currentFile" select="concat('/',filename/@abv)"/>
<xsl:variable name="Path" select="$currentFile"/>
</xsl:for-each>
...