xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: Converting to uppercaseusing text-transform
Date Mon, 06 Oct 2003 19:08:07 GMT
Abhijit Junnare wrote:
> So I want to translate all the content that comes
> under the <A Caps="Yes"> element to uppercase meaning
> including its children elements <B> <C> and <D>

Using parameter:
   <xsl:template match="A[@Caps='Yes']">
     <xsl:apply-templates>
       <xsl:with-param name="Caps" select="Yes"/>
     </xsl:apply-templates>
   </xsl:template>

   <xsl:template match="B|C|D">
     <xsl:param name="Caps"/>
     <xsl:apply-templates>
       <xsl:with-param name="Caps" select="$Caps"/>
     </xsl:apply-templates>
   </xsl:template>

   <xsl:template match="text()">
     <xsl:param name="Caps"/>
     <xsl:choose>
       <xsl:when test="$Caps='Yes'">
         <xsl:value-of select="translate(.,$lower,$upper)"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="."/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>

Beware: untested.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message