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

removing nodes according to attibute value

Subject: removing nodes according to attibute value
From: "Charles Ohana" <charles.ohana@xxxxxxxxxxxxxx>
Date: Tue, 1 Nov 2005 10:57:07 -0600
xml remove nodes containing attribute
Hello friends,
I'm trying to remove all elements that have a specific attribute containing some characters.
See example below... I need to remove all /ApplicationCatalogue/Category/Product that have @code starting with TT.
It has to be generic as the xml provided can have more attributes & elements.
Also I would need to remove the /ApplicationCatalogue/Category if it doesn't have any Product left after the removal
Any idea ??? Thanx a million ...



<ApplicationCatalogue name="42222_downloads_stg">
<Category name="2_live_crew" description="2_live_crew">
<Product code="TT050089891" position="0">
<Alias isDefault="true">
<Name>89891</Name>
<Extra></Extra>
</Alias>
<Attributes>
<OTAobject_otaother_namepreview>Getting High</OTAobject_otaother_namepreview>
<OTAobject_otaother_author>2 Live Crew</OTAobject_otaother_author>
</Attributes>
</Product>
<Product code="PP050089892" position="0">
<Alias isDefault="true">
<Name>89892</Name>
<Extra></Extra>
</Alias>
<Attributes>
<OTAobject_otaother_namepreview>Pimp Of The Year</OTAobject_otaother_namepreview>
<OTAobject_otaother_author>2 Live Crew</OTAobject_otaother_author>
</Attributes>
</Product>
<Product code="PP050089893" position="0">
<Alias isDefault="true">
<Name>89893</Name>
<Extra></Extra>
</Alias>
<Attributes>
<OTAobject_otaother_namepreview>Shake Junk Queen</OTAobject_otaother_namepreview>
<OTAobject_otaother_author>2 Live Crew</OTAobject_otaother_author>
</Attributes>
</Product>
<Product code="TT050089894" position="0">
<Alias isDefault="true">
<Name>89894</Name>
<Extra></Extra>
</Alias>
<Attributes>
<OTAobject_otaother_namepreview>Stop Playin</OTAobject_otaother_namepreview>
<OTAobject_otaother_author>2 Live Crew</OTAobject_otaother_author>
</Attributes>
</Product>
</Category>
</ApplicationCatalogue>


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.