Subject: [xsl] is it possible to access the previous context() From: Vladimir.Stanishev@xxxxxxxxxxxxxxxxxxx Date: Thu, 15 Mar 2001 17:28:34 -0000 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Inserting into a String, Borca, Olivier | Thread | Re: [xsl] is it possible to access , David Carlisle |
Re: [xsl] Functional programming in, Jeni Tennison | Date | RE: [xsl] is it possible to access , Don Bruey |
Month |