xsl-list
[Top] [All Lists]

RE: [xsl] Dublicate attribute to several image tags under transformation

2006-08-07 07:57:08
John

Without seeing your current XSLT I'm a bit in the dark but supposing you have a template that matches img then:
<xsl:template match="img">
 <img src="{(_at_)src}" img-id="{(_at_)img-id}" usemap="{(_at_)img-id}" />
</xsl:template>

If you don't have this template then show how you currently create the result img element.

Joe



From: "John Stubbe" <johnstubbe(_at_)msn(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Dublicate attribute to several image tags under transformation
Date: Mon, 07 Aug 2006 14:10:02 +0000

Dear XSLT experts

I have an issue regarding adding an extra attribute under a transformation.

I have an entry in my source XML file that consists of content from a WYSIWYG editor. I need to duplicate an attribute to all image tags which has been inserted.

My source XML file looks something like below:

<root>
<content>
This is some text <b>bold</b>
<img src="picture.jpg" img-id="picture.jpg"  />
<br />
Some more text and images
<img src="picture2.jpg" img-id="picture2.jpg"  />
</content>
</root>


When I do an XSL transformation I need to create a HTML page with the content from the ?content? node but to each img tag the result should look something like this (an ekstra attribute ?usemap? is added which is a copy of the img-id:
<img src="picture.jpg" img-id="picture.jpg" usemap=?picture.jpg? />

How is this possible ?

Thanks in advance

Cheers
John Stubbe
Denmark



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--