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

Re: union vs. "or" vs. contains?

Subject: Re: union vs. "or" vs. contains?
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 14:37:21 -0400
union vs. or
On Oct 19, 2004, at 7:03 AM, David Carlisle wrote:

The following does the same, but I think it's clearer, and it's probably
more efficient as the test only has to be done once, not on every
element that might possibly match.


<xsl:apply-templates select="*[$foo='x']"/>
or perhaps clearer
<xsl:if test="$foo='x'">
 <xsl:apply-templates/>
</xsl:if>

I'm not understanding how to implement this. How do I distinguish among the five different mods:modsCollection templates I'm applying if I'm not putting a conditional statement on the match statement of those templates?


This is what I started to do, but it's not making much sense to me.

<xsl:template match="db:bibliography">
<xsl:choose>
<xsl:when test="not($citation-class='note-nobib')">
<div id="bibliography">
<h2>References</h2>
<xsl:choose>
<xsl:when test="$citation-class='author-year'">
<xsl:apply-templates select="mods:modsCollection[$citation-class='author-year']" mode="bibliography"/>
</xsl:when>
<xsl:when test="$citation-class='citekey'">
<xsl:apply-templates select="mods:modsCollection[$citation-class='citekey']" mode="bibliography"/>
</xsl:when>
....
</xsl:choose>
</div>
</xsl:when>
</xsl:choose>
</xsl:template>


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.