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

Getting specific elements from a list

Subject: Getting specific elements from a list
From: "Simon, Jb" <jb.simon@xxxxxxxx>
Date: Thu, 26 May 2005 16:37:05 -0400
 Getting specific elements from a list
Hi, I have the following XML snippit :

<tblEnumeratedTypes>
	<EnumeratedType>ColorType</EnumeratedType>
	<tblEnumValues>
		<EnumeratedType>ColorType</EnumeratedType>
		<EnumValueDescription>Red</EnumValueDescription>
	</tblEnumValues>
	<tblEnumValues>
		<EnumeratedType>ColorType</EnumeratedType>
		<EnumValueDescription>White</EnumValueDescription>
	</tblEnumValues>
	<tblEnumValues>
		<EnumeratedType>ColorType</EnumeratedType>
		<EnumValueDescription>Blue</EnumValueDescription>
	</tblEnumValues>
</tblEnumeratedTypes>

What I need as output is 

TEST ( int, ColorType, Red, Blue )

The problem I'm having is getting the Red and Blue, basically, the 
First and last EnumeratedType element of EnumeratedTypes.

I tried various combinations, although it seems this should have
worked...

	<xsl:template match="tblEnumeratedTypes_WC" mode="range-macro">


test ( 
	int, 
	<xsl:value-of select="EnumeratedType"/>,
	<xsl:value-of select=".//EnumValueDescription[1]"/>,
	<xsl:value-of select=".//EnumValueDescription[last()]"/>
) ;

	</xsl:template>

When I execute that I get (line breaks are not a problem)

TEST ( 
	int, 
	ColorType,
	Red,
	Red
	) ;

What is the problem is that I can never get the last Value to be Blue.

Oh, XSL Procesor : Microsoft (R) XSLT Processor Version 4.0
Also tried it using Mozilla, same result

Any Ideas ?

TIA
Joe Simon

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.