This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Extending xsltproc?


You seem to be mixing questions about what XSLT can do with questions about
what xsltproc can do. Even if you are committed to xsltproc, you need to be
clear that these are different questions.
>
> Then again, maybe I don't need to extend it. The two transforms I
> would like to implement seem easy and commonplace, but are proving
> elusive: 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,

Yes, this is a very common requirement and is easily solved. You'll find the
techniques in any XSLT textbook or on the FAQ for this site. The first thing
is to realize that XSLT is producing nodes in a result tree, not tags in a
serialized output file.

> and I'd also like to be able to present
> a node-set in a new random order on each call.

There's no random() function in XSLT, but you can pass a random number into
the stylesheet as a parameter and use it to pseudo-randomize the output
order, e.g. by doing

<xsl:sort select="translate(generate-id(), "1234567890", string($random))"

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]