RE: [xsl] Selecting a particular attribute

Subject: RE: [xsl] Selecting a particular attribute
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Sat, 12 Jul 2003 13:40:35 -0500
You could try
  select="@*[position() = 2]"
(note the *)

As Mukul said, you may not be guaranteed that the attribute you
get is the one that comes second in the XML document; but
since I don't understand what it is you're trying to do,
the above could be what you want, even though it's unreliable.

Lars

> i think you cannot do that with XSLT. for XML files,
> position of attributes is insignificant. for e.g.
> <row vcEmpId="2003" vcEmpName="Test" vcSal="9515"/>
> will be same as <row vcEmpName="Test" vcEmpId="2003"
> vcSal="9515"/> as far as XML is concerned. 
> if attribute names are known, whats the *difficulty*
> in using attribute names?
> 
> Regards,
> Mukul
> 
> --- rajith r <ajth_r@xxxxxxxxxxx> wrote:
> > Hi all
> > 
> > How do I select a particular attribute based on
> > position.
> > 
> > For example
> > 
> > <row vcEmpId="2003" vcEmpName="Test" vcSal="9515"/>
> > 
> > I want to select the second attribute and i dont
> > want to use @vcEmpName, but 
> > i want to do some thing like this @[position()=2].
> > 
> > Thanks & Regards
> > Rajith
> > 
> >


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


Current Thread