This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: remaining part of( IF-Test...continued )
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 12 Mar 2002 20:05:35 +0100
- Subject: Re: [xsl] remaining part of( IF-Test...continued )
- References: <20020312113239.22572.qmail@web21302.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> My problem is the <book> element gets eliminated in
> the output altogether.
No, you never can "eliminate" any node. You must bear in mind that there is
a difference between the input tree and the output tree. If you want to copy
the <Book> from the input to the output, then you have to tell it to the
processor:
<xsl:template match="Book">
<!-- copy <Book> -->
<xsl:copy>
<!-- copy all attributes -->
<xsl:copy-of select="@*"/>
<!-- if no @ISBN add @NOCODE -->
<xsl:if test="not(@ISBN)">
<xsl:attribute name="NOCODE">
<xsl:text>B01</xsl:text>
</xsl:attribute>
</xsl:if>
</xsl:copy>
</xsl:template>
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list