RE: [xsl] how to delete an attribute after using it as a test

Subject: RE: [xsl] how to delete an attribute after using it as a test
From: "Noel Golding" <noel@xxxxxxxxxxxxxxx>
Date: Sun, 17 Nov 2002 12:28:20 -0500
After about 1 1/2 hr of searching the archives I finally found an answer
that works.  Does anyone have any tips on how to search the archives to help
decrease the amount of time it takes to search?  I am very new to XML XSL so
my knowledge of the syntax is limited.

Thanks
Noel


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Noel Golding
Sent: Sunday, November 17, 2002 11:13 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] how to delete an attribute after using it as a test


<!-- ================== -->
<!-- xml snip -->
<!-- ================== -->
<form_field label="First Name" hidden="true" name="fname" size="35"
maxlength="35" />


<!-- ================== -->
<!-- xsl snip -->
<!-- ================== -->
<xsl:template match="form_field">
 <xsl:if test="@hidden = 'true'">
  <xsl:element name="input">
<!--
******************************************
******************************************
**   HERE I WOULD LIKE TO COPY ALL
**   ATTRIBUTES EXCEPT @hidden and @label
******************************************
******************************************
-->
   <xsl:copy-of select="@*"/>
   <xsl:attribute name="type">hidden</xsl:attribute>
  </xsl:element>
 </xsl:if>
</xsl:template>

<!-- ================== -->
<!-- desired output -->
<!-- ================== -->
<input name="fname" size="35" maxlength="35" />


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread