[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Removing an XML Attribute

Subject: Removing an XML Attribute
From: "McDonald, Shaun" <Shaun.McDonald@xxxxxxxxxxx>
Date: Wed, 4 Jul 2007 14:10:22 -0400
 Removing an XML Attribute
Hi All,

I came up with something that appears to work, only I'm not sure if
there is a caveat to doing it this way.

Since I'm transforming almost 100 files, I want to make sure nothing
bites me in the rear.

Using XSLT 2.0, Saxon 8.8

<xsl:template match="*">
  <xsl:copy>
    <xsl:choose>
     <xsl:when test="not(@change)">
       <xsl:copy-of select="@* "/>
     </xsl:when>
     <xsl:otherwise/>
   </xsl:choose>
   <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

I'm still spot-checking the files, but so far it seems to have removed
the @change attribute only, which is my desired output.

Thanks!


Shaun McDonald
Coordinator, Engineering
JetBlue Airways
118-29 Queens Blvd.
Forest Hills, NY 11375
Phone: 718-709-2678

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.