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

Re: applying templates to all but ...

Subject: Re: applying templates to all but ...
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sat, 25 Sep 2004 21:08:30 -0400
xsl select all but
This is slightly more complicated as I work on it ...

On Sep 24, 2004, at 11:53 AM, David Carlisle wrote:

So if I have five in the list, and I want all of the first four that
are present in the config file to be applied first, and the last
(article) only, well, last (because it is the fallback)?  I use the
same syntax?

"all" or "any" ?


If you have [1] then only one will be used, the first one
for which their is a hit (using the fact that xslt2 sequences are
ordered, the order of strings in the sequence controls which you try first)
If you mean that you want _all_ of the first four to be applied if
elements with all those attributes are there then you'd need a different
syntax.

The logic is as follows:


All records have a class and a type. Class has to be deduced algorithmically, while type is based strictly on the value of mods:genre.

OK, so I have my variables that group types by class, like so:

<xsl:variable name="refclass-partInSerial"
     select="('article-newspaper','legal case','bill','article')"/>

.... and then, per David's (and Jeni's) suggestion, an apply-template like this:

<xsl:apply-templates select="$style-biblio/(for $t in $refclass-partInSerial
return cs:reftype[not(@inherit-from)][@name=$t])[1]/(cs:* except cs:creator)">
<xsl:with-param name="source" select="."/>
</xsl:apply-templates>


But, of course, this isn't quite right. What I need it to say is:

- if the mods:genre=some value, and that value has an equivalent style definition, then use it
- if not, then default to "article" (which is required)


Most of the time, it would be using he default.

So at it's most basic:

if mods:genre='legal case' and cs:reftype/@name='legal case' exists, use it, etc.

An additional complication is that the values of the mods:genre and cs:reftype/@name might not always quite line up.

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.