How about this?
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$input2=''">
<xsl:copy-of select="." />
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="document($input2/)" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: Farrukh S. Najmi <farrukh(_at_)wellfleetsoftware(_dot_)com>
Sent: Fri, 05 Jan 2007 15:19:49 -0500
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Selectively applying Identity transform to multiple inputs
(Multiplexer Style Sheet)
Dear colleagues,
I have a newbie question.
In my XSLT, in addition to my main input, I am reading a second input in
my XSLT using the document() function.
The second input's URL is specified via an <xsl:param>:
<xsl:param name="input2" select="''"></xsl:param>
I need to produce output tree that is either the identity transform of
the main input or the second input depending upon whether the parameter
$input2 is null/empty or not. If it is null/empty then the main input
should be copied to output tree. If it is not null/empty then the second
input should be copied to output tree.
I have been unable to do this correctly after much trying.
Can someone provide some guidance on how to accomplish this seemingly
simple task?
Thanks for your help.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.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>
--~--
--~------------------------------------------------------------------
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>
--~--