473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Filtering one set of elements based on another

This is probably dead simple - but it's getting late and I've be
staring at XSL for waaaay to long!

I have an XML file that basically contains two lists:
<root>
...
<list name="allItems">
<value>A</value>
<value>B</value>
<value>C</value>
</list>
<list name="exclude">
<value>A</value>
</list>
...
</root>

I want to be able to select all the value elements from the "allItems"
list that are NOT in the "exclude" list. I have soft-of-a solution
involving a few templates and if statements - yet I'm sure there's an
elegant way to do this with XPath, but I can't think of it.

And it's beginning to do my head in.

Cheers,

Jason "My head hurts" Irwin.
Jul 20 '05 #1
2 1006
I want to be able to select all the value elements from the "allItems"
list that are NOT in the "exclude" list.

select="list[@name='allItems']/value[not(.=../../list[@name='exclude']/value)]"

David
Jul 20 '05 #2
David Carlisle <da****@nag.co.uk> wrote in message news:<yg*************@penguin.nag.co.uk>...
select="list[@name='allItems']/value[not(.=../../list[@name='exclude']/value)]"

AH! Thank you!

JI
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: William Park | last post by:
1. Here is shell version of Python filter() for array. Essentially, you apply a command on each array element, and extract only those elements which it returns success (0). This is specialized...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
1
by: Raffle | last post by:
Hi all, I'm still fairly new to Access and I was hoping to get some assistance with something I have yet to accomplish. The desired result is a form where users can enter data but for a few...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
2
by: Konrad | last post by:
Hi Can you point examples in .NET of filtering (avoiding) displaying web pages with unwanted content on machine with ie? Thanks Konrad
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
2
by: sp | last post by:
hai i am new to this XSTL and i am trying to write xslt that will filter out the xml value based on Attribute Value. my xml looks like this <catalog> <cd> <title year="1990">Empire...
1
by: itssri.srinivas | last post by:
Hi, Below is the XSL syntax to filter output from XML file based on single value:- <xsl:for-each select="catalog/cd"> so, above code displays the text of the CD elements whose artist is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.