Re: Concat Content of Node to Another?
Thanks for you help, Jon and Michael. I really appreciate it. Plenty more to study, that's for sure.
I found I had something complicating things. I was trying to rename (make a new) element that contains the directory name. (That's the "BasePath" node below.) After I used the existing name, I had more success.
Here's the solution:
=========== The XSLT ====================
<!-- Set the value of the images directory name variable. -->
<xsl:value-of select="concat(translate(normalize-space(/Presentation/BuiltinProperties/BasePath),' ','_'),'/images/')"/>
<!-- Rename the Filename element -->
<!-- I did this to avoid conflict with the other 'Filename' node below.
I want to distinguish between them for reasons later in the process. -->
<!-- I did this to see if I could. I could! -->
<!-- Concat path onto filename of image, and change from swf to tif. -->
<xsl:value-of select="$dirname" /><xsl:value-of select="replace(.,'.swf','.tif')"/>
<!-- I have a couple of other things here... like changing the order of the nodes in Slide -->
============= The Before XML ===============
The original BasePath Node: <BasePath>IC 3 - Lesson 1 Expertise</BasePath>
And the (partial) Slide Node:
- <Slide id="1"> <Filename>slide1.swf</Filename> <BackgroundFile>bgtm1.swf</BackgroundFile> <Title>Expertise and Effective Office Warning Strategies</Title> </Slide>
============= After the Transform ==============
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format