-
random numbers in xslt ?????
is there a way to generate random numbers in xslt ????
i have a xml doc and a xslt doc to go with it. it transforms the page into
an html page. there are 3 nodes that it matches a template for. right now
the xslt pumps out the html in whatever order the 3 nodes are in the xml
doc. i want to rearange randomly. can i even do that ?
if i can't what would be the best approach ?
-
Re: random numbers in xslt ?????
Take a look at the XML 10-Minute solution article by Kurt Cagle--he shows
how to generate randomized data using a little script and XSLT. Here's the
link. Watch for linebreaks.
http://gethelp.devx.com/techtips/xml...kc031501-1.asp
You should also look at the count() function. Unless there are always three
nodes, you'll need the count function to count the number of nodes to
randomize. Given an index number (from a random function) you can select the
nodes in any order you want using XPath queries in your XSLT template.
"hassan" <mirzahassa@hotmail.com> wrote in message
news:3aedde55$1@news.devx.com...
>
> is there a way to generate random numbers in xslt ????
>
> i have a xml doc and a xslt doc to go with it. it transforms the page into
> an html page. there are 3 nodes that it matches a template for. right now
> the xslt pumps out the html in whatever order the 3 nodes are in the xml
> doc. i want to rearange randomly. can i even do that ?
>
> if i can't what would be the best approach ?
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks