Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different colors to different rows

 
Rahesh Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am very new to XML-XSL,i want to know whether it is possilble to generate different colors to different rows using XML-XSL,if so how can we generate it.

Do Help me out in this
Thanks
Rahesh
 
Richard Hands
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably you're outputting html? (not that it matters that much).

here's a quick example of how you could do it using MOD

----------- TEST XML DATA -------------

----------- END TEST XML DATA -------------

----------- EXAMPLE XSLT ------------------


[ October 27, 2004: Message edited by: Richard Hands ]
[ October 27, 2004: Message edited by: Richard Hands ]
 
Rahesh Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Richard,

Thanx for ur reply, Can it be done without specifying the colors, that is,lets assume that there are some 100 rows in the xml that i am going to use,in the xsl is it possible to give different colors to different rows without mentioning the colors,that is can the colors be chosen at random?

Can the basic colors percentages be varied in the xsl to get the ramdom colors generated?

I hope what i am explaining is clear.

Thanx in advance.

Rahesh
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahesh Kumar:
Hi Richard,
Can it be done without specifying the colors, that is,lets assume that there are some 100 rows in the xml that i am going to use,in the xsl is it possible to give different colors to different rows without mentioning the colors,that is can the colors be chosen at random?

What is the use of doing it ? What you will do the if the random bgcolor generated is black and the text color is also black.
The best option is to use alternate light color from the readability and visibility point of view.
 
Rahesh Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Balaji

Thank you very much for your reply, i just wanted to know whether it can be done like that or not.

Thanks
Rahesh
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahesh Kumar:
Hi Balaji
Thank you very much for your reply, i just wanted to know whether it can be done like that or not.
Thanks
Rahesh

Searching google I found this link , not sure whether it will help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic