xsl-list
[Top] [All Lists]

Re: empty attribute tags rendering in HTML

2006-02-27 13:14:03
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(_at_)mulberrytech(_dot_)com
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>