Alex Sergeyev wrote:
I'm thinking today about problem that seems simple but I don't
know XSL/XSP enough to imagine best way to solve it....

I have sequence:
<main>
        <sub>a</sub>
        <sub>b</sub>
        ...
        <sub>n</sub>
</main>

I should transform this to get RANDOMIZED sequence of
sub-elements each time for each user.
I can write my taglib but I would not like to rename sub to
mytaglib:sub elements... Also I wish to have more universal way
to be able re-order later big branches instead of such simple
sequences...

You don't necessarily need to rename those elements to "mytaglib:sub", all they need is to have a namespace. Taking your above snippet, all you'd need is:


 <main xmlns='http://foo.com/MyTagLib'>
        <sub>a</sub>
         <sub>b</sub>
         ...
        <sub>n</sub>
 </main>

and everything starting from <main> inclusive will be handled by your taglib.

As Simon said, XSLT doesn't normally do random, but if you're feeling brave you could write an extension function to XML::LibXSLT in Perl to do that.

--
Robin Berjon <[EMAIL PROTECTED]>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to