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

RE: deep copy and exclude some nodes

Subject: RE: deep copy and exclude some nodes
From: Peter Van de Water <peter.vandewater@xxxxxxxxxxxxxxx>
Date: Wed, 15 Jan 2003 08:57:01 +1300
xsl copy exclude
*[not(name() = 'field1' and name() = 'field2')]

As a general rule, use not() whenever you need to build up an exclusion set
first. Working with XSL is like working with SQL - your operations are
usually on sets, not single values.

Peter

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Joeri Belis
Sent: Tuesday, 14 January 2003 10:04 p.m.
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  deep copy and exclude some nodes


hi,

<line>
 <field1>1</field1>
 <field2>2</field2>
 <field3>3</field3>
</line>

i am processing the <line> node in this simplified example.
and i need to copy this node 2 times. The first is a copy of everything and
the second should exclude <field2>

giving this result

<line>
 <field1>1</field1>
 <field2>2</field2>
 <field3>3</field3>
</line>
<line>
 <field1>1</field1>
 <field3>3</field3>
</line>

I used
<xsl:copy>
  <xsl:copy-of select="@*"/>
  <xsl:copy-of select="*[name() != 'field2']"/>
<xsl:copy>

But what when i need to remove more fields.
I tried   <xsl:copy-of select="*[name() != 'field1' and name() !=
'field2']"/> but is not working.

I think this is the wrong approach.

Joeri



 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

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.