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

Re: Extending xsltproc?

Subject: Re: Extending xsltproc?
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 2 May 2002 11:01:23 -0400
xsltproc non xml
[Gary Lawrence Murphy]

>
> What I am hearing, and allow me a novice rephrasing, is that a better
> approach is to do a for-each over the original list, and use a test
> for modulo N = zero whereupon I recursively call the template starting
> on the ((row * N) + 1)th element.
>
> But what if I wanted to split the other way: place ordered items
> down the first column to some position value N, then N+1 to 2N are
> in column 2, 2N+1 to 3N in column three and so forth?
>

It wouldn't be very different, except that you would have to have nested
templates.  One would split the dataset up into columns, and the other would
create the rows in any one cell.  The main point to remember is to have each
template create a well-formed fragment of xml - that is, it should start
with an opening tag and end with the matching closing tag.  That way, if the
template gets called at all, it has to produce complete elements.

That's one of the things people mean when they say to use the xslt model
(which is a model of transforming trees) rather than try to spit out non-xml
bits like your original </tr><tr>.

It seems to me that some variation of the nXm problem has already been
worked out on the list.  Usually these questions have come up in the context
of coloring different cells  or rows different colors.  You might want to
look in the archives and xslt tutorial sites for threads on coloring rows,
and see if you find anything close enough to use as a starting point.

Cheers,

Tom P


 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.