[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: use-when attribute?

Subject: RE: use-when attribute?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 18 Dec 2004 13:13:27 -0000
xsl template use when
> 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"/>
> 


I would be inclined to do it with template rules:

<xsl:template match="db:biblioref">
  <xsl:apply-templates select="@linkend" mode="z"/>
</xsl:template>

<xsl:template match="cite:biblioref">
  <xsl:apply-templates select="@cite:key" mode="z"/>
</xsl:template>

<xsl:template match="@*" mode="z">
  ...
</xsl:template>

etc.

But perhaps I haven't understood the problem.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.