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

Omnimark vs. XSL (Saxon) Challenge improved

Subject: Omnimark vs. XSL (Saxon) Challenge improved
From: Michael Müller-Hillebrand <info@xxxxxxxxxxxxx>
Date: Wed, 17 Mar 2004 17:13:53 +0100
omnimark windows xp
Thanks to all your tips and suggestions!

I have a table like this with width attributes scattered all over the table in the td elements:

+-----------+-----------+
| a         | b         |
|           +-----+-----+
|           | c   | d   |
+-----------+-----+     |
| e               |     |
+-----+-----+-----+     |
| f   |?g???| h   |     |
+-----+-----+-----+-----+

I need the column widths collected in the table element: 
<table width="w1 w2 w3 w4">

The problem is to find that the width attribute of cell "c" is not valid for column 1 (although it is cell #1 in row #2) but column 3 instead.

My current solution is working but still slow (using my computer and Instant Saxon 6.5.3 on Windows XP):

64 rows: 2 secs
128 rows: 7.5 secs
192 rows: 19 secs
256 rows: 30 secs

The basic steps of the solution are:

1a) Create a list of <cell col="x" row="y" /> elements, one for every un-spanned cell.

1b) Create a simplified table which removes all colspans but keeps rowspans.

2) Parse the simplified table and set attributes in the list of cells to show which cells are already used. This allows me to check, to which column cell "c" belongs, because the first to entries in row #2 are already used at this time.

3) For each column in the list of cell elements find the first with a width attribute.

4) Process the original table with the new width attribute and drop the individual td widths.

I added additional comments to the stylesheet and together with my explanation the case hopefully a little bit clearer than yesterday. This following page contains links to data files and shows input, stylesheet and output:

http://cap-studio.de/test/challenge.html

Now it is the algorithm, which may be unnecessarily costly? I hope so... all suggestions are appreciated!

- Michael
-- 
_____________________________________________________________
Dipl.-Ing. Michael Müller-Hillebrand
                                      
"Mehr Effizienz für Wissensarbeiter" --> http://cap-studio.de

 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.