|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: matching multiple times, outputting once?
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








