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

calculating math:matrix longest column strings

Subject: calculating math:matrix longest column strings
From: "Matthew L. Avizinis" <mla@xxxxxxxxx>
Date: Wed, 15 Oct 2003 16:26:25 -0400
math matrix
Hello all,
I need some help.
suppose I have a math:matrix of 4 columns by 4 rows (but the matrix could be of any size). I am currently "looking at" a math:mn in the 2nd row, 3rd column during processing of an XSLT transform. I need to be able to find and sum the longest cell in each of the preceding two columns. By the "longest" cell, I mean the cell which has the longest string in the column. In other words, I need to add together the lengths of the longest strings in all the preceding columns of the current element being processed. The structure of the matrix conforms to the w3c schema for mathML, so use any example you like such as
<math>
<matrix>
<matrixrow>
<mn>1</mn>
<mn>10</mn><!-- longest in column -->
<mn>2</mn>
<mi>a</mi>
</matrixrow>
<matrixrow>
<msup><mi>x</mi><mn>2</mn></msup><!-- longest in column -->
<mn>1</mn>
<mn>2</mn>
<mi>x</mi>
</matrixrow>
<matrixrow>
<mn>1</mn>
<mn>1</mn>
<mn>2</mn>
<mn>3</mn>
</matrixrow>
<matrixrow>
<mn>1</mn>
<mn>1</mn>
<mn>2</mn>
<mn>3</mn>
</matrixrow>
</matrix>
</math>


So, for purposes of this example,  the answer would be 4.
Thanks in advance,
Matthew L. Avizinis
Gleim Publications, Inc.


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.