This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Manipulation of XSL attributes


Hi all,
	I'm having a problem with the manipulation
of attribute values as follows..

Lets say I have an element
<img src="x.bmp" alt="z.bmp" align="" hspace=""/>
and a param in my XSL called $path, which for this
example has the value "y.bmp"

My desired output is:
<img src="y.bmp" alt="z.bmp"/>  

As can be seen from above I've added in the $path and removed
empty attribute values.

The problem is I'm having no joy implementing this in my XSL.
I was attempting to implement this by building up an attribute set
such as:

<xsl:attribute-set name="attributes">
	<xsl:attribute name="src"><xsl:value-of select="$path"/></xsl:attribute>
	<xsl:if test="string(@alt)">
		<xsl:attribute name="alt"><xsl:value-of select="@alt/></xsl:attribute>
	</xsl:if>
</xsl:attribute-set>
.......
<xsl:copy use-attribute-sets="attribute">

This gives me an error !!
Any ideas anyone ???



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]