[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Transposing matrices
Nickolay - should the 'embedded' matrices be transposed as well? then maybe <xsl:template match="matrix"> <!-- no need for // --> <xsl:variable name="matrix" select="."/> <matrix> <xsl:for-each select="row[1]/item"> <xsl:variable name="i" select="position()"/> <row> <xsl:for-each select="$matrix/row"> <item><xsl:apply-templates select="item[$i]/*"/></item> </xsl:for-each> </row> </xsl:for-each> </matrix> </xsl:template> provided there's a template (eg the default) for text that copies content that isn't a matrix. also, this may not work with non-text, non-matrix items! otherwise, replace the value-of with copy-of : <xsl:copy-of select="item[$i]"/> (no enclosing <item> tags as you get them anyhow with the copy-of) btw, you wrote: <xsl:for-each select="//row"> this will match on all rows of all matrices, probably not what you want hth, /m 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
|