This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: remaining part of( IF-Test...continued )


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]