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

RE: following sibling attribute

Subject: RE: following sibling attribute
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 20:11:31 +0100
xpath following sibling attribute
This is a very simple transformation, and you don't need to use preceding or
following sibling. When processing the parent of the <CHANNELRESULTS>
elements, do

tr
for-each CHANNELRESULTS
  td
    value-of @channel
  /td
/for-each
/tr

tr
for-each CHANNELRESULTS
  td
    value-of @ControlInhibitorRFU
  /td
/for-each
/tr

and so on.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Sripriya
> Venkataraman
> Sent: 29 April 2002 17:28
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  following sibling attribute
>
>
> Hi,
>
> I have the following XML that I am trying to convert into
> text using XSL.
>
> <CHANNELRESULTS Channel="1" ControlInhibitorRFU="140.88"
> BaselineRFU="232.04" WidthAtHalfHeight="16.90" NoiseAvg="242.10"
> NoiseStdev="6.90" InhibitionNoiseAvg="12.94"
> InhibitionNoiseStdev="4.30">
> <CHANNELRESULTS Channel="2" ControlInhibitorRFU="141.91"
> BaselineRFU="376.62" WidthAtHalfHeight="14.50" NoiseAvg="393.22"
> NoiseStdev="13.71" InhibitionNoiseAvg="11.48"
> InhibitionNoiseStdev="5.58">
> <CHANNELRESULTS Channel="3" ControlInhibitorRFU="162.61"
> BaselineRFU="454.27" WidthAtHalfHeight="14.80" NoiseAvg="472.27"
> NoiseStdev="15.29" InhibitionNoiseAvg="10.91"
> InhibitionNoiseStdev="2.87">
>
> I want the text output as:
>
> Channel			1		2		3
> ControlInhibitorRFU	140.88	141.91	162.61
> BaselineRFU			232.04	376.62	454.27
> ...
>
> How do I select all the attributes from the preceding or
> following nodes ?
> What am I doing wrong ??
>
> 	<xsl:template match="CHANNELRESULTS">
> 		<xsl:if test="position() = last()">
> 		<xsl:for-each select="@*">
> 			<xsl:value-of select="."/>
> 			<xsl:value-of
> select="preceding::node()/name(.)"/>
> 		</xsl:for-each>
> 		</xsl:if>
> 	</xsl:template>
>
> Thanks,
> Priya
>
>
>  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.