[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: use-when
At 2010-12-10 01:43 +0200, Andriy Gerasika wrote:
I cannot figure out how to use use-when attribute, beyond standard "system-property('file-separator')" example. That is the only context of using it, as those are the only properties defined when the use-when= attributes are evaluated. From section 3.12 of XSLT 2.0: There are no syntactic constraints on the XPath expression that can be used as the value of the use-when attribute. However, there are severe constraints on the information provided in its evaluation context. These constraints are designed to ensure that the expression can be evaluated at the earliest possible stage of stylesheet processing, without any dependency on information contained in the stylesheet itself or in any source document. My code is overflown w/ "conditional" templates like: Have you yet tried using modes for your problem? <xsl:choose> <xsl:when test="$file-set='A'"> <xsl:apply-templates mode="file-set-A"/> </xsl:when> <xsl:when test="$file-set='B'"> <xsl:apply-templates mode="file-set-B"/> </xsl:when> <xsl:when test="$file-set='C'"> <xsl:apply-templates mode="file-set-C"/> </xsl:when> </xsl:choose> ... <xsl:template match="some-xpath1" mode="file-set-A"> <xsl:template match="some-xpath2" mode="file-set-B"> <xsl:template match="some-xpath3" mode="file-set-C"> I hope this helps. . . . . . . . . . Ken -- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|