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

RE: Getting specific elements from a list

Subject: RE: Getting specific elements from a list
From: JBryant@xxxxxxxxx
Date: Thu, 26 May 2005 16:35:01 -0500
xsl delete specific elements
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

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.