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

How to add a string to an attribute

Subject: 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
qmd_itemtype
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

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