xsl-list
[Top] [All Lists]

Re: [xsl] Selectively applying Identity transform to multiple inputs (Multiplexer Style Sheet)

2007-01-05 14:36:22
cknell(_at_)onebox(_dot_)com wrote:
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>
  
Thanks very much! This does the trick very nicely.

How can I extend above so that I can do selective transformation of some
nodes in the output tree?
For example what if I want to suppress the copying of some nodes based
on a parameter value.

Here is a sample template to selectively copy tp:Comment element. I cant
figure out how how to wire
this to what you suggested earlier.

    <!--
    Only copy tp:Comment if $copyComment is not null
    -->
    <xsl:template match="tp:Comment">       
        <xsl:if test="$copyComment != ''">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:if>       
    </xsl:template>   


Thanks again.

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

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