This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Selecting and sorting attributes from dynamic headers...
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Selecting and sorting attributes from dynamic headers...
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 7 Aug 2001 13:44:04 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> My XML file is:
>
> <XmlData>
Names beginning "xml", in any case combination, are reserved for future
standardisation. Most parsers let them through, but some don't.
> <Headers>
> <Column label="att1" />
> <Column label="att4" />
> <Column label="att2" />
> <Column label="att7" />
> </Headers>
> <Results>
> <Row att1="AAA" att2="BBB" att3="CRC" ... att10="NNN" />
> <Row att1="AAA" att2="BAB" att3="CCT" ... att10="NNN" />
> <Row att1="AAA" att2="BCB" att3="CEC" ... att10="NNN" />
> <Row att1="AAA" att2="DBB" att3="CCR" ... att10="NNN" />
> <Row att1="AAA" att2="BBE" att3="CCC" ... att10="NNN" />
> </Results>
> </XmlData>
>
> The Headers node is a param of my XSL file. I'd like to
> generate a HTML
> table with the attributes specified in the Headers node in
> the same order of
> the Column nodes. I thought it was simple, but I can't to it !!
Something like:
<xsl:for-each select="//Row">
<xsl:variable name="row" select="."/>
<xsl:for-each select="//Column/@label"
<td><xsl:value-of select="$row/@*[name()=.]"/></td>
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list