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

RE: configuring a conditional

Subject: RE: configuring a conditional
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 23 May 2005 09:07:35 +0100
position gt xml
Are you sure it isn't feasible to express the rules directly as match
patterns?

<xsl:template match="citation/name[position() gt 2 and position() lt 6]">
  <renderas font-style="italic">et al.</renderas>
</xsl:template>

(I know that example doesn't work, but you get the idea).

Alternatively I've seen this sort of thing done by applying dyn:evaluate to
XPath expressions held in a rule table:

<interest when=". gt xs:date('2004-01-01') and . le xs:date('2004-05-12')"
value="5.5"/>

The way you're tackling it, you're going to need to build those expressions
before evaluating them - I wonder if that's really necessary?

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

> -----Original Message-----
> From: Bruce D'Arcus [mailto:bdarcus@xxxxxxxxx] 
> Sent: 23 May 2005 02:28
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  configuring a conditional
> 
> In my XSLT, I need to configure formatting for so-called "et al." 
> handling in citations; e.g. (Smith et al. 1999).  Sometimes this gets 
> quite complicated, such that I've settled on this sort of config 
> markup:
> 
>        <multi-name-replace>
> 	<rule when-more-than="2" and-less-than="6" 
> and-position="subsequent" 
> use-first="1"/>
> 	<rule when-more-than="6" and-position="first" use-first="1"/>
> 	<renderas font-style="italic">et al.</renderas>
>        </multi-name-replace>
> 
> Now my question is, how would I actually implement this in 
> the XSLT?  I 
> can't rely on the and-less-than attribute to present, nor even the 
> entire multi-name element.
> 
> Or is there a better way to make the markup suitable for 
> transformation 
> (it's my schema, so I can make it whatever I want!)?
> 
> Bruce

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.