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 Need to execute the code inside XSLT exactly once. 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 "Need to execute the code inside XSLT exactly once." Watch "Need to execute the code inside XSLT exactly once." New topic
Author

Need to execute the code inside XSLT exactly once.

Jayesh Bhapkar
Greenhorn

Joined: Jan 27, 2012
Posts: 3
Hi,
How to execute the code in XSLT exactly once inside xsl:for-each ?

During transformation, I need to check for existence of some value (inside xsl:for-each), if value exists do some operation, if it doesn't I need to do some other operation but only once.
Is there any way to do the same in XSLT ?

(Using <xsl:otherwise> is not an option here since, it will repeat the operation as many times the xsl:for-each runs)

Any sort of help is highly appreciated.

Thanks,
Jayesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to execute the code inside XSLT exactly once.
 
Similar Threads
Exit condition in an XSL for loop - need help
some question to Mr.Dmitry Kirsanov:
doubt about namespace.
Counter in XSLT
xsl:apply-templates