|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extending xsltproc?
[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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








