Subject: Re: [xsl] Writing an optional element From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 05 Jul 2004 17:12:35 -0400 |
Nestor> Is there a better way to do it than:
Nestor> <xsl:choose> <xsl:when test="condition"> <element> Nestor> ... processing instructions ... </element> </xsl:when> Nestor> <xsl:otherwise> ... repeat processing instructions ... Nestor> </xsl:otherwise> </xsl:choose>
If by a better way, you mean you want to avoid writing the same "continue processing" code, then you could call a named template each time. Said named template to contain the common code.
<xsl:template match="span[@display='i']"> <i> <xsl:apply-templates/> </i> </xsl:template>
<xsl:template match="span"> <xsl:apply-templates/> </xsl:template>
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Writing an optional eleme, Colin Paul Adams | Thread | make an fo:table with XSLT from an , Le Déaut Stéphane |
Re: [xsl] Writing an optional eleme, Colin Paul Adams | Date | make an fo:table with XSLT from an , Le Déaut Stéphane |
Month |