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

identifying the specific comments associated with an e

Subject: identifying the specific comments associated with an element
From: avi paradise <aparadise@xxxxxxxxxxxxxxx>
Date: Thu, 25 Mar 2004 21:10:18 -0500
avi paradise
I would like to process data that is in the following format.

<dataItems>
     <!-- this is a comment about the first item -->
     <item name="itemName1">I1</item>

     <!-- this is a comment about the second item -->
     <!-- this is a follow on comment for 2nd item -->
     <item name="itemName2">I2</item>

     <!-- this is a comment about the third item -->
     <!-- 3rd item also has an additional comment line -->
     <item name="itemName3">I3</item>

     <!-- this is a comment about the fourth item -->
     <item name="itemName4">I4</item>
</dataItems>

In particular I would like to be able to  process one item at a time as
is customarily done with <xsl:apply-templates select="/dataItems/item" />

What I don't understand how to do is associate the comments with the appropriate data items.
For instance, how would I process this data to convert the comments into attributes as follows:


<dataItems>
<item name="itemName1" comment="this is a comment about the first item">I1</item>


<item name="itemName2" comment="this is a comment about the second item. this is a follow on comment for 2nd item">I2</item>

<item name="itemName3" comment="this is a comment about the third item. 3rd item also has an additional comment line">I3</item>

<item name="itemName4" comment="this is a comment about the fourth item">I4</item>
</dataItems>


Or how would I select the item whose name is "itemName3" along with it's comments? i.e call
<xsl:apply-templates select="/dataItems/item/[@name = 'itemName3']" /> and within the item template grab the comments
<!-- this is a comment about the third item -->
<!-- 3rd item also has an additional comment line -->



Thanks, ap

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.