[xsl] Transposing matrices

Subject: [xsl] Transposing matrices
From: Nickolay Kolev <nmkolev@xxxxxxxxxxx>
Date: Sun, 20 Oct 2002 17:10:45 +0200
Hi all,

I amy trying to wite a stylesheet that will transpose matrices 
written in the following format: 

<item>xxx</item><item>yyy</item> ...

.. more rows ... here


The stylesheet I have come up with so far (thanks to a very old 
message at this forum actually) is: 

<xsl:template match="//matrix">
<xsl:for-each select="//row[1]/item">
<xsl:variable name="i" select="position()"/>
  <xsl:for-each select="//row">
    <item><xsl:value-of select="item[$i]"/></item>

This does work perfectly if the items contain "normal data". The  
stylesheet must however work as well with items that may contain 

I know the way the matrices are selected should be modified but I 
can't figure out how. 

Could anyone please help?

Many thanks in advance,
Nickolay Kolev

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread