xsl-list
[Top] [All Lists]

Re: [xsl] Making all attributes empty and retaining the attributes names

2008-05-30 06:03:46
Pankaj Chaturvedi wrote:

I've also tried it prior. But doesn't seems to be working.

   <xsl:template match="@*">
     <xsl:attribute name="{name()}"/>
   </xsl:template>


I think that template is fine for doing what you want (copying attributes with their names but with empty values), now you also need to make sure you process attribute nodes e.g.
  <xsl:template match="*">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>


--

        Martin Honnen
        http://JavaScript.FAQTs.com/

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