[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Getting specific elements from a list
I think Dimitre's solution is the better choice, as it avoids the overhead of a variable and the extra processing of the // operator. So if you ever want to optimize, look at Dimitre's suggestions again. Still, I'm glad we could help you make something that works. Jay Bryant Bryant Communication Services (presently consulting at Synergistic Solution Technologies) "Simon, Jb" <jb.simon@xxxxxxxx> 05/26/2005 04:24 PM Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx To xsl-list@xxxxxxxxxxxxxxxxxxxxxx cc Subject RE: Getting specific elements from a list > -----Original Message----- > From: Dimitre Novatchev [mailto:dnovatchev@xxxxxxxxx] > Sent: Thursday, May 26, 2005 5:08 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: Getting specific elements from a list> > > The correct XPath expressions to use are, therefore: Snip > > (.//EnumValueDescription)[1] > > and > > (.//EnumValueDescription)[last()] > > > > Of course, in this particular case it is best *not* to use the "//" > abbreviation. What would suffice is just: > > tblEnumValues/EnumValueDescription[1] > > and > > tblEnumValues/EnumValueDescription[last()] > > > -----Original Message----- > From: JBryant@xxxxxxxxx [mailto:JBryant@xxxxxxxxx] > Sent: Thursday, May 26, 2005 5:09 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: Getting specific elements from a list > Snip > <xsl:variable name="EVDs" select="//EnumValueDescription"/> > > <xsl:template match="tblEnumeratedTypes"> > test ( > int, > <xsl:value-of select="EnumeratedType"/>, > <xsl:value-of select="$EVDs[1]"/>, > <xsl:value-of select="$EVDs[last()]"/> > ); > </xsl:template> Thanks to all ... I ended up using Jay Bryant's Solution, I could not get Dimitres' solution to work, Kept getting blanks, although I now understand what was going on and it looks like his solution should also work. I just had to change Jay's solution from > <xsl:variable name="EVDs" select="//EnumValueDescription"/> To <xsl:variable name="EVDs" select=".//EnumValueDescription"/> Thanks to All ! Joe Simon Lockheed Martin, Systems Integration, Owego, NY
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|