This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: outputing a non existant element.
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] outputing a non existant element.
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Wed, 12 Sep 2001 21:08:08 +0200
- References: <20010912171755.18902.qmail@web13404.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
what about this snippet:
<xsl:choose>
<xsl:when test="fruit">
<xsl:value-of select="fruit"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>apple</xsl:text>
</xsl:otherwise>
</xsl:choose>
Getting the value out of the schema-file is not possible I think.
I know something about a default-value of an attribute. If the attribute is
not specified the XSLT-processor returns this default-value. But I heard,
this behaviour is not specified too. It works in Xalan.
Joerg
----- Original Message -----
From: "Auguste Oumar" <oumar_a@yahoo.de>
To: <XSL-List@lists.mulberrytech.com>
Sent: Wednesday, September 12, 2001 7:17 PM
Subject: [xsl] outputing a non existant element.
> Hi,
> i have one optional element in my schema-file say:
> <fruit>orange</fruit>.The default value of fruit is
> "apple".I would like to have a xslt-transformation
> which gives me the content of the fruit element if it
> appears in the xml-file or its default value if it
> doesn't appear.I have problem giving out the default
> value when the element doesn't appear in the
> xml-file.How can i solve it ?
>
> Thanks for help.
>
> Auguste
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list