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

getting inner elements from a nested for-each?

Subject: getting inner elements from a nested for-each?
From: Paul Tomsic <ptomsic@xxxxxxxxx>
Date: Wed, 29 Jan 2003 16:23:44 -0800 (PST)
xslt for each inner
 I'm trying to find the right XSLT to output dataSets
 into groups associated with a radio button for each
 set.
 So, I want to loop over each "dataSet"
 then loop over the sub-elements contained in there, 
 in my instance, <Image><Head><subhead>
 How do I get to Image, Head and subhead ?

 I've got the following on my XSL:
							<xsl:variable name="dataSet"
select="dataSets/dataSet"/>
 <xsl:for-each select="$dataSet">
 <xsl:variable name="current" select="local-name()"/>
  <tr><td>
<input type="radio" name="dataSet"
value="{@dataSetName}"/>
  </td>
  <td>
    <xsl:value-of select="@dataSetName"/>
   </td>
   <td>
<xsl:variable name="innerElement"
select="$current/*"/>
<xsl:for-each select="$innerElement">
<xsl:value-of select="."/><BR/>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>


And my XML:

 <dataSets>
  <dataSet

xmlns="http://ns.adobe.com/GenericCustomNamespace/1.0/"
 dataSetName="Data Set 1">
   <Image>file:one.jpg</Image>
   <Head><p>So many things</p></Head>
   <subhead><p>have to do with health</p></subhead>
  </dataSet>
  <dataSet

xmlns="http://ns.adobe.com/GenericCustomNamespace/1.0/"
 dataSetName="Data Set 2">
   <Image>file:two.jpg</Image>
   <Head><p>Alpha</p></Head>
   <subhead><p>Beta</p></subhead>
  </dataSet>
 </dataSets>


thoughts/help?

thanks,
Paul



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 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.