[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: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Tue, 6 Nov 2001 15:36:21 -0000
Re:  matching multiple times
try adding these templates


<xsl:template match="*[@bold='Yes' ]">
 <b><xsl:apply-templates/></b>
</xsl:template>

<xsl:template match="*[@bold='Yes' and @italic='Yes' ]">
 <b><i><xsl:apply-templates/></i></b>
</xsl:template>

<xsl:template match="*[@bold='Yes' and @italic='Yes' and
@underline='Yes' ]">
 <b><i><u><xsl:apply-templates/></u></i></b>
</xsl:template>




----- Original Message -----
From: "McKeever, Marty" <marty.mckeever@xxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, November 05, 2001 3:15 PM
Subject:  matching multiple times, outputting once?


> This is really bugging me, because i thought it would be simple.  Maybe it
> is, and i'm just having a mental block -- thanks for your help.
>
> Here are 3 possibilities that i have to match for, and 3 desired outputs:
>
> <emphasis bold="Yes">Hello</emphasis>
> <emphasis bold="Yes" italic="Yes">Hello</emphasis>
> <emphasis bold="Yes" italic="Yes" underline="Yes">Hello</emphasis>
>
> <b>Hello</b>
> <i><b>Hello</b></i>
> <u><i><b>Hello</b></i></u>
>
> and every possible combination thereof.
>
>
> I have had no luck writing an intelligent template rule for these -- the
> only way i've found so far is a deeply nested <xsl:choose> which takes
every
> possible combination into account.  This can't be the best way to do this.
>
> Everything else i've tried either matches only one rule, or outputs
"Hello"
> multiple times, one for each style.
>
> There has to be an elegant solution i'm missing...
>
> (and yes, i know i could easily write this out as <span
> style="font-style:bold,italic;text-decoration:underline">Hello</span>, but
> that's not what i'm looking for here.)
>
> TIA!
> marty
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.