Re: How to optionally create an attribute?

Subject: Re: How to optionally create an attribute?
From: James Clark <jjc@xxxxxxxxxx>
Date: Mon, 15 Nov 1999 12:12:47 +0700
Donald Ball wrote:
> 
> Hiya. I've got some elements that I'd like to optionally have attributes.
> I tried the obvious:
> 
> <element>
>  <xsl:if test="$condition">
>   <xsl:attribute name="name">value</xsl:attribute>
>  </xsl:if>
>  ...
> </element>

That's the right way.
 
> but (the latest) XT did not like this.

It just tried:

<element xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xsl:version="1.0">
 <xsl:if test="true()">
  <xsl:attribute name="name">value</xsl:attribute>
 </xsl:if>
 foobar
</element>

and it worked fine.

James


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread