xsl-list
[Top] [All Lists]

Re: applying templates to all but ...

2004-09-24 08:53:37


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.


Actually, the optional types only get applied from this template if 
they do not contain an "inherit-from" attribute.  Does that change how 
you'd code it?  Here's what you had:

<xsl:apply-templates
select="$style-biblio/(for $t in ('article-newspaper','article')
                 return cs:reftype[(_at_)name=$t])[1]/cs:*">

I don't carry a picture of your input in mmy head so I have trouble
mapping the english "optional types" to any part of that expression but
perhaps

<xsl:apply-templates
select="$style-biblio/(for $t in ('article-newspaper','article')
                 return cs:reftype[not(@nherit-from)][(_at_)name=$t] )[1]/cs:*">


..... and what would, say, the variable actually look like?

A long time since I did any electronics but some kind of electron state
change in some silicon somewhere.

I just meant replace ('article-newspaper','article') by $foo

and have 
<xsl:variable name="foo" select="('article-newspaper','article')"/>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


<Prev in Thread] Current Thread [Next in Thread>