|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Concat Content of Node to Another?
It Works!
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. Thanks, Don ....... Here's the solution: =========== The XSLT ==================== <!-- Set the value of the images directory name variable. --> <xsl:variable name="dirname"> <xsl:value-of select="concat(translate(normalize-space(/Presentation/BuiltinProperties/BasePath),' ','_'),'/images/')"/> </xsl:variable> <!-- 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. --> <xsl:template match="Presentation/Filename"> <xsl:element name="Source"> <!-- I did this to see if I could. I could! --> <xsl:attribute name="file"> <xsl:value-of select="$dirname"/> </xsl:attribute> <xsl:apply-templates/> </xsl:element> </xsl:template> <!-- Concat path onto filename of image, and change from swf to tif. --> <xsl:template match="Filename"> <xsl:element name="Filename"> <xsl:value-of select="$dirname" /><xsl:value-of select="replace(.,'.swf','.tif')"/> </xsl:element> </xsl:template> <!-- 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
|

Cart








