This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Names of node attributes
- From: "KUMAR NINGASHETTY" <kningashetty at deltafunding dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 24 Apr 2002 18:38:55 -0400
- Subject: RE: [xsl] Names of node attributes
- Reply-to: xsl-list at lists dot mulberrytech dot com
I guess the following solution is for attribute "values " and what you need is getting attribute "names" rite ...
correct me if i am wrong ...
-K
>>> sara.mitchell@ps.ge.com 04/24/02 04:30PM >>>
To get the attributes from WELL inside A with type="a",
you need something like:
<xsl:for-each select="A[type="a"]/WELL/@*">
...rest of your template...
</xsl:for-each>
If you only need attributes of a specific name, replace
the @* with the name of that attribute to get that attribute.
You can also use | in the select to get several attributes,
something like:
<xsl:for-each select="A[type="a"]/WELL/@ab | A[type="a"]/WELL/@cd">
Sara
> -----Original Message-----
> From: Sripriya Venkataraman
> [mailto:Sripriya.Venkataraman@calipertech.com]
> Sent: Wednesday, April 24, 2002 1:01 PM
> To: 'xsl-list@lists.mulberrytech.com'
> Subject: RE: [xsl] Names of node attributes
>
>
> 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@deltafunding.com]
> Sent: Wednesday, April 24, 2002 12:24 PM
> To: xsl-list@lists.mulberrytech.com
> 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@calipertech.com 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