• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

different colors to different rows

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic