xsl-list
[Top] [All Lists]

Re: applying templates to all but ...

2004-09-24 06:03:00

This

              <xsl:when test="$issuance = 'continuing'">
                <xsl:choose>
                  <xsl:when 
test="$style-biblio/cs:reftype[(_at_)name='article-newspaper']">
                  <xsl:apply-templates 
select="$style-biblio/cs:reftype[(_at_)name='article-newspaper']/cs:*">
                    <xsl:with-param name="source" select="."/>
                  </xsl:apply-templates>
                  </xsl:when>
                  <xsl:otherwise>
                  <xsl:apply-templates 
select="$style-biblio/cs:reftype[(_at_)name='article']/cs:*">
                    <xsl:with-param name="source" select="."/>
                  </xsl:apply-templates>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>


could be written as

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

and I suspect the outer choose could be simplified as well although I
haven't follwed all your logic.

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
________________________________________________________________________