[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Transposing matrices

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

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

<matrix>
<row>
<item>xxx</item><item>yyy</item> ...
</row>
<row>
..
</row

.. more rows ... here

</matrix>

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

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

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

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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.