Re: [xsl] Extending xsltproc?

Subject: Re: [xsl] Extending xsltproc?
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 25 Apr 2002 13:41:44 -0400
[Gary Lawrence Murphy]

>
>     >> ... I would like to render a node-set into rows of columns
>     >> without resorting to disable-output-escaping to insert the
>     >> modulo-column </tr><tr> break,
>
>     M> Yes, this is a very common requirement and is easily
>     M> solved. You'll find the techniques in any XSLT textbook
>
> Sadly not in the XSLT book I have :(  If it is in Tidwell's book, I
> can't find it -- I'll check the FAQ.
>
Gary, you have not provided much information, that's why you have gotten
these generic answers.  Everyone is assuming that you have a
straight-forward problem like ones that have been answered many times.

>     M> ... The first thing is to realize that XSLT is producing nodes
>     M> in a result tree, not tags in a serialized output file.
>
> This is what I'd thought, which is why I was surprised when the only
> example I could find, the stylesheets in the recommended Amazon XML
> package, used the doe method in a serialized output; it just seemed
> wrong.

It is "wrong" unless you have an really unusual problem.  It sounds like you
have an ordinary situation, but it's hard to be sure.  The main thing is
probably to understand how you decide where to break up the tables with the
extra row elements.  Say it is just every ten rows.  Then you probably would
write a recursive template that does ten rows, then updates a position
indicator and calls itself, passing the position indicator.

If the breaks depend on some marker in the content, you would select
elements for the grouping into rows based on that criterion.

I realize that this is still general, but it should give some idea of how to
proceed.  You have to supply more information if you want more targeted
help.  It is very unlikely that you would need to resort to
disable-output-escaping, but you have to get your problem formulated clearly
(in tree terms, that is).

Cheers,

Tom P



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread