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

AW: adressing attributes

Subject: AW: adressing attributes
From: Michael Zehrer <zehrer@xxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Jun 2001 13:12:27 +0200
adressing
ok, I found it myself...

<xsl:choose>
	<xsl:when test="../element[$here+$half]">
	<xsl:for-each select="../element[$here+$half]">
		<xsl:value-of select="@id"/>
	</xsl:for-each>
	</xsl:when>
	<xsl:otherwise></xsl:otherwise>
</xsl:choose>	

-----Ursprüngliche Nachricht-----
Von: Michael Zehrer [mailto:zehrer@xxxxxxxxxxxxxxxxxx]
Gesendet: Freitag, 29. Juni 2001 12:31
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff:  adressing attributes


Thanks to the FAQ I learned howto "Making balanced two-column tables from
one-column data", but I also want to list one attribute and really don't
know how to address it. 

This is my XML:

<page>
	<element id="sometext">content</element>
	...
</page>

and my XSL is:

<xsl:variable name="t-size" select="count(//element)"/>
<xsl:variable name="half" select="ceiling($t-size div 2)"/>
		   
<table>
	<xsl:for-each select="//element[position() &lt;= $half]">
	<xsl:variable name="here" select="position()"/>
	<tr>
	<td><xsl:value-of select="@id"/></td>
	<td><xsl:value-of select="."/></td>
	<td><xsl:value-of select="@id"/></td>
	<td>
	<xsl:choose>
		<xsl:when test="../element[$here+$half]">
			<xsl:value-of select="../element[$here+$half]"/>
		</xsl:when>
		<xsl:otherwise></xsl:otherwise>
	</xsl:choose>
	</td>
	</tr>
	</xsl:for-each>
</table>

Sure, at the moment the @id in the 3rd cell gives the same value as the one
in the first cell, but it should contain the value of the id attribute of
the 4th cell element. I tried to construct something similar to the 4th cell
xsl code, but it just don't work. Can someone explain it to me?

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

 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.