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

Re: Help with Parameters

Subject: Re: Help with Parameters
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 27 Sep 2006 20:47:18 +0100
help with parameters
> Unfortunately, the <desc> text that matches the  parameter is being
> output twice:

so you must  have two apply-templates, but you only showed one, so it's
a bit hard to guess. 

Cant't you just have a single template


<xsl:template match="desc" mode="leader">
 <xsl:param name="special_desc"/>
<xsl:choose>
<xsl:when test="$special_desc='yes'">
<fo:wrapper font-style="italic" font-weight="normal">
   <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
   <xsl:value-of select="."/>
  </fo:wrapper>
</xsl:when>
<xsl:otherwise>
 <xsl:if test="not(
  <fo:block margin-left="8em" font-style="italic" font-weight="normal">
   <xsl:apply-templates select="@* | *[contains(@type, $my_version) or string-length(@type)=0] | text()"/>
  </fo:block>
</xsl:otherwise> 
</xsl:choose>
</xsl:template>

But still even with one template you are (probbaly) going to get things output
twice if you apply templates twice.



Incidentally don't do
<xsl:with-param name="special_desc">yes</xsl:with-param>
which makes a result tree fragment with a root node and a text node,
which is relatively expensive, just do
<xsl:with-param name="special_desc" select="'yes'"/>
which makes a string, or in this case, even better would be
<xsl:with-param name="special_desc" select="true()"/>
which you could test directly as

 <xsl:param name="special_desc" select="false()"/>
<xsl:choose>
<xsl:when test="$special_desc">


David

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.