xsl-list
[Top] [All Lists]

Re: Testing if an attribute name is in a list of names

2005-05-19 06:47:09
Paul,


That's getting closer to what I want, at least in terms of neatness.
I'm just wondering if we can get rid of the nested for-each.


For what it's worth, the following does not have explicit nested loops, but that's just a matter of syntax.


<?xml version="1.0" encoding="iso8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
   <xsl:output method="text"/>

<xsl:variable name="meta-col-names" select="/data/outcomes/column/@attName"/>

   <xsl:template match="/">
       <xsl:apply-templates select="data/rows/row"/>
   </xsl:template>

   <xsl:template match="row">
       <xsl:apply-templates select="@*[name() = $meta-col-names]"/>
       <xsl:text>&#xa;</xsl:text>
   </xsl:template>

   <xsl:template match="row/@*">
       <xsl:value-of select="."/>
   </xsl:template>

</xsl:stylesheet>

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--