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

is it possible to access the previous context()

Subject: is it possible to access the previous context()
From: Vladimir.Stanishev@xxxxxxxxxxxxxxxxxxx
Date: Thu, 15 Mar 2001 17:28:34 -0000
barcap vladimir
Hi all. 
Is it possible to access the previous context in nested <xsl:for-each>
loops.   

for example if my xml file is:

<root>
	<FilterTypes>
		<FilterType type="red"/>
		<FilterType type="green"/>
		<FilterType type="orange"/>
		<FilterType type="blue"/>	
	</FilterTypes>
	<Filters>
		<Filter>
			<Name>Not Shiny</Name>
			<Value>blah</Value>
			<FitlerType type="red" value="34"/>
			<FitlerType type="blue" value="87"/>
		</Filter>
		<Filter>
			<Name>Shiny</Name>
			<Value>other</Value>
			<FitlerType type="green" value="12"/>
			<FitlerType type="orange" value="13"/>
			<FitlerType type="blue" value="15"/>
		</Filter>
	</Filters>
</root>

I am trying to do the following:

<table>
<xsl:for-each select="/root/FilterTypes/FilterType">
  <tr>
   <xsl:for-each select ="/root/Data/Filters">
	<xsl:for-each select="Filter">
		<td>here I want to display the @value attribute for the
FilterType element of the current Filter where the @type attribute is equal
to the @type attribute of the current /root/FilterTypes/FilterType in the
context of the outermost for loop. ugh.  even I get confused by this
sentence but it's right, that's what I am trying to do. 
		</td>
	</xsl:for-each>
   </xsl:for-each>
  </tr>
</xsl:for-each>
</table>

the output I am looking for is the following:

		Not Shiny		Shiny
red		  34			Nan
green		NaN			12
orange		NaN			13
blue		 87			15

I am not sure if this is possible the way the xml file is structured. 
Thanks in advance any help is really appreciated.  

Vladimir.  


--------------------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.


Internet communications are not secure and therefore the Barclays Group
does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do 
not necessarily represent those of the Barclays Group unless otherwise 
specifically stated.

--------------------------------------------------------------------------------------

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


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.