xsl-list
[Top] [All Lists]

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

2002-11-17 10:46:18
sorry, If found the answer here.
<!-- ANSWER -->

http://www.biglist.com/lists/xsl-list/archives/200211/msg00618.html

<xsl:copy-of select="@*[not(name()='hidden' or name()='label')]"/>



Thanks
Noel Golding

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
Noel Golding
Sent: Sunday, November 17, 2002 11:13 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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



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