Re: [xsl] use-when attribute?

Subject: Re: [xsl] use-when attribute?
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Fri, 17 Dec 2004 21:43:03 -0500
On Dec 17, 2004, at 3:50 AM, Michael Kay wrote:

However, I'm not sure whether this is the right design for your problem. I
would be inclined to stick with the traditional approach: the
special-purpose stylesheet module (here, the XHTML output module) should
import the general-purpose module, not the other way around; and you then
decide which special-purpose module to use by using that as your entry point
to the transformation.

Thinking about this more, I'd like to adopt this approach for the output side.


This still leaves me with the input problem. I have this as my key input document dependent variable:

<xsl:variable name="citerefs" select="//db:biblioref/@linkend"/>

Is there some elegant way to use the correct xpath expression depending on the input document?

An "if then else" works if there's only two options, but I'll have more than that.

I suppose one obvious approach would be this ...

	<xsl:variable name="citerefs" select="//db:biblioref/@linkend |
									//cite:biblioref/@cite:key |
									//tei:cit/@href"/>

.... but I'm worried that's a bad idea from a performance standpoint. Any other alternatives?

Bruce

Current Thread