xsl-list
[Top] [All Lists]

[xsl] use-when

2010-12-09 17:43:59
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>