File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes doing a dynamic thing in xslt 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 "doing a dynamic thing in xslt" Watch "doing a dynamic thing in xslt" New topic
Author

doing a dynamic thing in xslt

Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
Hi guys,
I need suggestions for a XSL related problem.

I have a XML which contains employment history of users. There can be multiple records depending upon users history.
On this XML, a XSL file is applied. For each of the employment records , different styles are to be applied. Hence I am retrieving the data in <xsl:for-each>. For 1st record if <div class="class1"> is applied , for 2nd record <div class="class2"> should be applied and hence forth.. How can i dynamically do this as number of records is not known before..

Thanks in adavance
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Do you know about the position() function?
Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
Nope. how do we use the position() function
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Well, first you look it up to find out more about it. Then you ask specific questions about it if you don't see how it would help you solve that question.
 
jQuery in Action, 2nd edition
 
subject: doing a dynamic thing in xslt
 
Similar Threads
How to prevent DIV from reloading
parsing repeating subdocuments
can you name a form variable in XSL dynamically?
XSL to display XML output in multiple pages
How would be the best way to parse HTML Content ?