|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Axis-Name help
Hi Bix,
bix xslt wrote: I want to create a nodeset for a variable which contains each column of data. No, it doesn't. You're not too far off - here's something that illustrates what I think you want do (you could make it shorter by eliminating the columnCells variables, but don't do that until you're comfortable with what's going on): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <matrix> <xsl:for-each select="grandp/parent"> <xsl:variable name="pos" select="position()"/> <xsl:variable name="columnCells" select="//parent/child[position() = $pos]"/> <xsl:call-template name="column"> <xsl:with-param name="columnCells" select="$columnCells"/> </xsl:call-template> </xsl:for-each> </matrix> </xsl:template> <xsl:template name="column">
<xsl:param name="columnCells"/>
<column>
<xsl:for-each select="$columnCells">
<xsl:copy-of select="."/>
</xsl:for-each>
</column>
</xsl:template>
</xsl:stylesheet>As you realised, you have to "freeze" the current position, but you can then use it very simply. Francis. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








