[xsl] How to add a string to an attribute

Subject: [xsl] How to add a string to an attribute
From: "Uslu, Cihan Y (MED)" <Cihan.Uslu@xxxxxxxxxx>
Date: Thu, 9 Oct 2003 11:19:42 -0500
Hi, 
Following is the XML snippet that I'm working with;

<questestinterop>
	<item title="TT-1003_Mod01_Objective01_Title:"
ident="5112114679096874">
		<itemmetadata>
		<qmd_itemtype>Multiple Choice</qmd_itemtype>
		<qmd_status>Normal</qmd_status>
		<qmd_toolvendor>Vendor</qmd_toolvendor>
		<qmd_topic>Biomed Training\TT-1003</qmd_topic>
		</itemmetadata>
	<item>
	<item title="TT-1003_Mod01_Objective01_Title:"
ident="5112114679096874">
		<itemmetadata>
		<qmd_itemtype>Multiple Choice</qmd_itemtype>
		<qmd_status>Normal</qmd_status>
		<qmd_toolvendor>Vendor</qmd_toolvendor>
		<qmd_topic>Biomed Training\TT-1003</qmd_topic>
		</itemmetadata>
	<item>
            ....
            ....
</questestinterop>

What I want to do is; to count the item element and add this value in
front of title attribute and copy the rest of the information as it is.
What is the best way of doing this?


This is the desired output;

<questestinterop>
	<item title="001_TT-1003_Mod01_Objective01_Title:"
ident="5112114679096874">
		<itemmetadata>
		<qmd_itemtype>Multiple Choice</qmd_itemtype>
		<qmd_status>Normal</qmd_status>
		<qmd_toolvendor>Vendor</qmd_toolvendor>
		<qmd_topic>Biomed Training\TT-1003</qmd_topic>
		</itemmetadata>
	<item>
	<item title="002_TT-1003_Mod01_Objective01_Title:"
ident="5112114679096874">
		<itemmetadata>
		<qmd_itemtype>Multiple Choice</qmd_itemtype>
		<qmd_status>Normal</qmd_status>
		<qmd_toolvendor>Vendor</qmd_toolvendor>
		<qmd_topic>Biomed Training\TT-1003</qmd_topic>
		</itemmetadata>
	<item>
            ....
            ....
</questestinterop>

...........
Thanks,



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


Current Thread