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

Re: [xsl] empty attribute tags rendering in HTML


Subject: Re: [xsl] empty attribute tags rendering in HTML
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 27 Feb 2006 15:14:03 -0500

Or, more concisely:

<xsl:template match="a|td|img">
  <xsl:copy>
    <xsl:copy-of select="@*[normalize-space()]"/>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

Cheers,
Wendell

At 01:41 PM 2/27/2006, it was written:
<xsl:template match="a|td|img">
<xsl:element name="{name()}">
<xsl:for-each select="@*">
<xsl:if test="not(normalize-space(.) = '')">
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>


======================================================================
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