Subject: Re: [xsl] empty attribute tags rendering in HTML From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 27 Feb 2006 15:14:03 -0500 |
<xsl:template match="a|td|img"> <xsl:copy> <xsl:copy-of select="@*[normalize-space()]"/> <xsl:apply-templates/> </xsl:copy> </xsl:template>
Cheers, Wendell
<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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] empty attribute tags rend, Spencer Tickner | Thread | RE: [xsl] empty attribute tags rend, Michael Kay |
RE: [xsl] constructing a "variable", Michael Kay | Date | Re: [xsl] when to use 'as' attribut, Dimitre Novatchev |
Month |