xsl-list
[Top] [All Lists]

Re: [xsl] Conditional use of <xsl:apply-imports> or <xsl:import> XSLT 2.0

2008-07-12 08:09:41
3. Finally, is this a correct method to approach?

It does not appear on the surface to be incorrect. On the other hand, you
haven't provided many particulars.

Am I correct that you have a variable choosing where <xsl:apply-imports/> should go?

If yes, then you may define a selector element, and create an indirect call to dispatch processing.

main style:

<xsl:variable name="selector" as="element">
 <xsl:element name="{define a selector here}"/>
</xsl:variable>

...

<xsl:template match="article/meta/journalcode[.='ABCD' | 'EFGH' | 'IJKL' |
'LMNO']">

 <xsl:apply-templates mode="call" select="$selector">
<xsl:with-param name="context-item" select="."/> </xsl:apply-templates>
</xsl:template>

import style 1:

<xsl:template mode="call" match="style 1 selector">
<xsl:with-param name="context-item" select="."/>
 <xsl:apply-templates select="$context-item"/>
</xsl:template>

...

import style N:

<xsl:template mode="call" match="style N selector">
<xsl:with-param name="context-item" select="."/>
 <xsl:apply-templates select="$context-item"/>
</xsl:template>

--
Vladimir Nesterovsky



--~------------------------------------------------------------------
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>
--~--