[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to add a string to an attribute
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|