|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] simulating conditional <xsl:include> behavior?
I am wondering if there is an obvious solution that I'm overlooking here,
perhaps involving XML parameter or general entities or something.
What I would like to do is the equivalent of wrapping <xsl:include> in an
<xsl:if> or <xsl:for-each>. I want to pull into my stylesheet certain XSLT
templates only when certain conditions are true -- namely, the presence of
certain data in a source document. The goal is to cut down on the overhead
of parsing myriad XSLT documents before the meat of the XSLT processing can
begin.
sample XML fragment that lists all possible templates:
<myXML>
<templates>
<template name="foo" URI="bar.xsl">
<template name="baz" URI="maz.xsl">
<template name="hello" URI="world.xsl">
</templates>
<data>
<foo>process me</foo>
<baz>process me</baz>
</data>
</myXML>
sample XSL fragment illustrating the effect I'd like to achieve:
<xsl:for-each select="/myXML/data/*">
<xsl:include href="{/myXML/template[@name=.]/@URI}"/>
</xsl:for-each>
Of course, the href attribute on <xsl:include> is not an attribute value
template and <xsl:for-each> isn't allowed at the top level, so this isn't
the right approach. Any suggestions appreciated. I'm using XT.
-Mike
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








