[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Fw:

Subject: Fw:
From: "mohamed" <mohamed@xxxxxxxxx>
Date: Tue, 1 Feb 2000 15:35:31 -0500
mohamed b. mohamed
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
  • Fw:
    • mohamed - Tue, 1 Feb 2000 15:35:31 -0500 <=

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.