[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

use-when

Subject: use-when
From: Andriy Gerasika <andriy.gerasika@xxxxxxxxx>
Date: Fri, 10 Dec 2010 01:43:49 +0200
 use-when
Hello,
I cannot figure out how to use use-when attribute, beyond standard "system-property('file-separator')" example.


My code is overflown w/ "conditional" templates like:

<xsl:template match="some-xpath1[$file-set='A']">
<xsl:template match="some-xpath2[$file-set='B']">
<xsl:template match="some-xpath3[$file-set='C']">

$file-set is declared as parameter, but it is not really a parameter, it is the same for all files converted in a set, other parameters vary for each file.

I think System.setProperty("file-set", "A") is not a good choice, because there can be many transforms running in the background.

How to properly rewrite above "pseudo" use-when to "true" use-when, i.e.:
<xsl:template match="some-xpath1" use-when="user-property('file-set')='A'">
p.s.
I use Saxon-9 HE

Thank You
Andriy Gerasika
http://www.gerixsoft.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.