[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: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 24 Sep 2004 16:53:37 +0100
Re:  applying templates to all but ...
> 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[@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)][@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
________________________________________________________________________

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.