This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes different colors to different rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "different colors to different rows" Watch "different colors to different rows" New topic
Author

different colors to different rows

Rahesh Kumar
Ranch Hand

Joined: Sep 10, 2004
Posts: 53
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

Joined: Feb 25, 2004
Posts: 12
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

Joined: Sep 10, 2004
Posts: 53
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

Joined: Jul 13, 2001
Posts: 3150
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.


Spritle Software Blogs
Rahesh Kumar
Ranch Hand

Joined: Sep 10, 2004
Posts: 53
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

Joined: Jul 13, 2001
Posts: 3150
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: different colors to different rows
 
Similar Threads
Generate xsl from DTD
How can I apply a XSL to the result of another XSL?
JTable row coloring
JSP Vs (XML and XSL)
How to convert XML file to an HTML file using XSLT