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

Re: matching multiple times, outputting once?

Subject: Re: matching multiple times, outputting once?
From: Goetz Bock <bock@xxxxxxxxxxx>
Date: Wed, 7 Nov 2001 09:59:25 +0100
name combinationes
> try adding these templates
> 
> <xsl:template match="*[@bold='Yes' ]">
> </xsl:template>
> 
> <xsl:template match="*[@bold='Yes' and @italic='Yes' ]">
> </xsl:template>
> 
> <xsl:template match="*[@bold='Yes' and @italic='Yes' and
> @underline='Yes' ]">
> </xsl:template>

while this will work for the mentioned cases, it will not work for all
    the combinationes there of: b, i, u, bi, bu, iu, ibu.

what about this:

<xsl:template match="emphasis">
  <xsl:call-template name="emphasis_b" />
</xsl:template>  

<xsl:template name="emphasis_b">
  <xsl:choose>
    <xsl:when test="@bold='Yes'">
      <b><xsl:call-template name="emphasis_i"/></b>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="emphasis_i"/>
    <xsl:otherwise>
  </xsl:choose>  
<xsl:template>  
    
<xsl:template name="emphasis_i">
  <xsl:choose>
    <xsl:when test="@italic='Yes'">
      <i><xsl:call-template name="emphasis_u"/></i>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="emphasis_u"/>
    <xsl:otherwise>
  </xsl:choose>  
<xsl:template>  

<xsl:template name="emphasis_u">
  <xsl:choose>
    <xsl:when test="@underline='Yes'">
      <i><xsl:value-of select="."/></i>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="."/>
    <xsl:otherwise>
  </xsl:choose>  
<xsl:template>  


-- 
Goetz Bock                                              IT Consultant
Dipl.-Inf. Univ.

Attachment: pgp00000.pgp
Description: PGP signature

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.