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

accessing node by position

Subject: accessing node by position
From: "Vincent Finn" <vincent.finn@xxxxxxxxxxxxx>
Date: Wed, 19 May 2004 11:05:40 +0100
vincent finn
Hi,

I need to access an xml value by it's position.
can this be done (or is there a better way to do it)

I have the xml below for generating a table.
I process <columns> to build the table header, then <rows> to build
the body.

When I am in a cell I need to find the type of the data for formatting
I don't know how to access the correct type node

I was thinking of something like
<xsl:value-of select="../../../columns/column(position())/type"/>
but after reading the faq that sort of 'on-the-fly' XPath generation
isn't allowed

Is there a nice way doing this?

Any help appreciated!

	Vin

<table>
	<columns>
		<column>
			<type>datetime</type>
			<value>time</value>
		</column>
		<column>
			<type>float</type>
			<value>Item1</value>
		</column>
		<column>
			<type>int</type>
			<value>Item2</value>
		</column>
		<column>
			<type/>
			<value>Item3</value>
		</column>
	</columns>
		
	<rows>
		<row>
			<cell>
				<value>2004-05-05T12:53:34.873</value>
			</cell>
			<cell>
				<value>1567.98765</value>
			</cell>
			<cell>
				<value>136</value>
			</cell>
			<cell>
				<value>hello</value>
			</cell>
		</row>
	</rows>
</table>

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.