RE: [xsl] Names of node attributes

Subject: RE: [xsl] Names of node attributes
From: Sripriya Venkataraman <Sripriya.Venkataraman@xxxxxxxxxxxxxxx>
Date: Wed, 24 Apr 2002 15:31:42 -0700
All wells have the same attributes. I want to extract the attribute names
from which ever WELL appears first.

I have one more question regarding xsl:sort.

<A type="a">
	<WELL WellName="E4"/>
	<WELL WellName="A1"/>
</A>
<A type="b">
	<WELL WellName="B6"/>
	<WELL WellName="C14"/>
	<WELL WellName="C8"/>
</A>

I want the output sorted on WellName attribute as:
A1 (rest of the attributes for this WELL)
B6 (rest of the attributes for this WELL)
C8 (rest of the attributes for this WELL)
C14 (rest of the attributes for this WELL)
E4 (rest of the attributes for this WELL)

What is wrong with this XSL ? This does not give me the desired result

<xsl:template match="WELL">
 	<xsl:for-each select=".">
 		<xsl:sort select="@WellName"/>
	 	<xsl:for-each select="@*">
			<xsl:value-of select="."/> <xsl:value-of
select="$tab"/>
	 	</xsl:for-each>
	 	<xsl:value-of select="$newline"/>
	 </xsl:for-each>
</xsl:template>

Thanks for your help.
Priya

-----Original Message-----
From: KUMAR NINGASHETTY [mailto:kningashetty@xxxxxxxxxxxxxxxx]
Sent: Wednesday, April 24, 2002 1:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Names of node attributes



Do you mean that you have to extract distinct attribute names from each
<WELL> node ...If my interpretation is correct ...
try using xsl:key  technique on those attribute Names ..that should give you
distinct attrs...

- kumar

>>> Sripriya.Venkataraman@xxxxxxxxxxxxxxx 04/24/02 04:00PM >>>
In my document there are multiple WELL elements like this :

<A type="a">
	<WELL/>
	<WELL/>
</A>
<A type="b">
	<WELL/>
	<WELL/>
</A>


I want distinct attribute names from the first WELL element. How can I do
this ?

Thanks,
Priya

-----Original Message-----
From: KUMAR NINGASHETTY [mailto:kningashetty@xxxxxxxxxxxxxxxx] 
Sent: Wednesday, April 24, 2002 12:24 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Subject: Re: [xsl] Names of node attributes


Try this ...This should work for U ..

<xsl:for-each select="data/WELL/@*">
     <xsl:value-of select="name(.)"/>
   <br/>
 </xsl:for-each>

-kumar


>>> Sripriya.Venkataraman@xxxxxxxxxxxxxxx 04/24/02 02:46PM >>>
Hi,

I have an XML fragment like this:
<WELL WellName="A1" WellStartTime="225.30" BaselineRSI="492.87"
DipRSI="18.01" PositivePercentInhibition="16.52" PeakRSI="24.13"
NegativePercentInhibition="22.14" NoiseFactor="4.88"
MinMaxDifference="43.43" /> 

>From this, I want to use XSL and get all the attribute names separated by a
tab into a variable like this:
Well	Well Start Time	Baseline SI	Dip RSI	Positive (%) Inhibition	Peak
RSI	Negative (%) Inhibition	Noise Factor (%)	MinMax Difference

Will this work ?
<xsl:variable name="wellattributes" select="name(WELL/@*)"/>

What am I doing wrong ?

Thanks for your help.
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 

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



 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