This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Conditional attributes based on presence of a child element
- To: Wolfgang Bogacz <wbogacz at omicron dot com>
- Subject: Re: [xsl] Conditional attributes based on presence of a child element
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Fri, 16 Mar 2001 10:49:47 +0000
- CC: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <BED89E201B46D311BAC100902765086A0ACE70@postmaster.omicron-usa.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Wolfgang,
Your input and stylesheet gives exactly what you want when I try with
Saxon 6.2 and MSXML3. Is there something about namespaces that you've
left out somewhere?
BTW, you could use:
<xsl:attribute name="type">
<xsl:choose>
<xsl:when test="processdata">y</xsl:when>
<xsl:otherwise>x</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
instead, as you're always adding the attribute, just changing its
value.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list