[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] calling templates depending on content


Subject: Re: [xsl] calling templates depending on content
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 29 Oct 2004 12:37:12 -0400

Still tweaking David,

At 05:20 AM 10/29/2004, he wrote:
> Is there a better way (XSL1.0) to call a template depending on
> "/main/template/@name"?

replace

<xsl:template name="start">

by

<xsl:template match="@name='start'">

but he meant


<xsl:template match="@name[.='start']">...</xsl:template>
<xsl:template match="@name[.='query']">...</xsl:template>

etc.

and replace all of

 <xsl:choose>
  <xsl:when test="/main/template/@name = 'start'">
   <xsl:call-template name="start"/>
  </xsl:when>
  <xsl:when test="/main/template/@name = 'query'">
   <xsl:call-template name="query"/>
  </xsl:when>
  ...
 </xsl:choose>

by

<xsl:apply-templates select="/main/template/@name"/>

Yeah. (Or do it Mike's way.)


Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


Current Thread
Keywords
xml