RE: [xsl] Conditionally use attribute sets?

Subject: RE: [xsl] Conditionally use attribute sets?
From: JBryant@xxxxxxxxx
Date: Mon, 14 Nov 2005 11:13:18 -0600
> The entire choose block could be eliminated if attribute-sets were
> not restricted to QNames.  I would have thought runtime composition
> of these names was a natural place for version 2.0 to go, but it
> has not.
>
> I have always wanted to write this:
>
> <xsl:attribute name="xsl:use-attribute-sets" select="{$who}"/>

If the attribute should always be present, you could just write:

<bachelor xsl:use-attribute-sets="{$who}"/>

You'd only need to use a conditional block and an attribute instruction in 
cases where the attribute might not exist.

You could also create structures like this one:

<bachelor xsl:use-attribute-sets="{if ($who='') then 'Oscar' else $who}"/>

That's potentially very powerful stuff.

I'd be in favor of a change like that if it won't cause problems in some 
other context.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

Current Thread