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

Re: Concat Content of Node to Another?

Subject: Re: Concat Content of Node to Another?
From: "Donald M Rinderknecht" <Donald.M.Rinderknecht@xxxxxxxx>
Date: Mon, 12 Dec 2005 17:01:55 -0600
concat image html
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.



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/')"/>

<!-- 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"/>

<!-- 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')"/>

<!-- 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">
   <Title>Expertise and Effective Office Warning Strategies</Title>


============= After the Transform ==============

- <Slide id="1"> <BackgroundFile>bgtm1.swf</BackgroundFile> <Title>Expertise and Effective Office Warning Strategies</Title> <Filename>IC_3_-_Lesson_1_Expertise/images/slide1.tif</Filename> </Slide>


Current Thread


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.
First Name
Last Name
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.