Subject: Fw: From: "mohamed" <mohamed@xxxxxxxxx> Date: Tue, 1 Feb 2000 15:35:31 -0500 |
I'm trying to call templates based on attribute
names:
<?xml version="1.0"?>
<testText > <text bold="yes">WITH BOLD</text> <text bold="yes" italic="yes"> WITH BOLD AND ITALIC</text> </testText> so I declared templates that are called
and match bold and italics,
<xsl:template match="bold"
name="bold">
<b>
<xsl:apply-templates/>
</b>
</xsl:template> <xsl:template match="italics"
name="italics">
<i>
<xsl:apply-templates/> </i></xsl:template> and I want to get an output as
follows:
<b>WITH BOLD</b>
<b><i>WITH BOLD AND
ITALIC</i></b>
but because the
<xsl:apply-templates match=""> and the
<xsl:call-template name=""> don't evaluate
expressions (like a variable $att whose value is bold, or the name() function
that returns the name of the attribute) within the match and the name attributes
I couldn't call the templates!
I don't know how many attributes I'll have (bold,
italics, small, .... etc) so I want to make it flexible enough so adding one
more attribute requires just adding a new template that matches it.
any suggestions?!
thanks ........
----------------------------------
Mohamed Abdelrahman
|
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: <xsl:attribute>, Carl Soane | Thread | RE:, Carl Soane |
<xsl:attribute>, patrick honner | Date | RE: <xsl:attribute>, Carl Soane |
Month |