cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MORAVEK Peter <mora...@pobox.sk>
Subject RE: XSL question
Date Wed, 05 Jan 2000 14:06:31 GMT
Sorry, I have already found the solution for my problem - <xsl:call-template
name="AAA"/>

Peter Moravek

> -----Original Message-----
> From: MORAVEK Peter [mailto:moravek@pobox.sk]
> Sent: Wednesday, January 05, 2000 2:14 PM
> To: 'cocoon-dev@xml.apache.org'
> Subject: XSL question
> 
> 
> Hello, 
> 
> I'm using the XSLT to convert XML to HTML. Some of the same 
> HTML output I
> need to use on several places, so I have extracted it to one 
> xsl:template
> (say <xsl:template match="AAA">). Everyting work fine, until I need to
> insert the template AAA dynamically according to some IF 
> condition, example:
> 
> input:
> -------
> <root>ok</root>
> 
> xslt:
> -----
> <xsl:template match="root">
>   <HTML>
>     <HEAD>
>     </HEAD>
>     <BODY>
>       <xsl:if test="root[.='ok']">
>         <xsl:element name="AAA"/>
>         <xsl:apply-templates select="AAA"/>
>       </xsl:if>
>     </BODY>
>   </HTML>
> </xsl:template>
> 
> <xsl:template match="AAA">
>   <B>inside of the AAA template</B>
> </xsl:template>
> 
> wrong output:
> ------------------
> <HTML>
>   <HEAD>
>   </HEAD>
>   <BODY>
>     <AAA></AAA>
>   </BODY>
> </HTML>
> 
> correct output:
> ---------------------
> <HTML>
>   <HEAD>
>   </HEAD>
>   <BODY>
>     <B>inside of the AAA template</B>
>   </BODY>
> </HTML>
> 
> I don't know, how to insert the <AAA> tag into XML while 
> processing XSL and
> to apply the template AAA to this tag.
> 
> Thans for help
> 
> Peter Moravek
> 

Mime
View raw message