473,402 Members | 2,055 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,402 software developers and data experts.

Finding elements without specific descendants

I'm trying to take a large XML file and identify a subset of nodes.
The XML has a structure similar to:

<root>
<home>
<test>junk</test>
</home>
<home>
<xxx>Hi There!</xxx>
<aaa>No value add</aaa>
<test>More testing</test>
<bbb>More nothing</bbb>
</home>
Jul 24 '07 #1
2 1625
mw******@yahoo.com wrote:
What I'd like to do is find <homenodes that do not have the <aaa>,
<xxxor <bbbchild elements.
/root/home[not(aaa) and not(bbb) and not(xxx)]

http://www.w3.org/TR/xpath#predicates
http://www.w3.org/TR/xpath#booleans

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Jul 24 '07 #2
On Jul 24, 2:42 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
mwebb...@yahoo.com wrote:
What I'd like to do is find <homenodes that do not have the <aaa>,
<xxxor <bbbchild elements.

/root/home[not(aaa) and not(bbb) and not(xxx)]

http://www.w3.org/TR/xpath#predicate...xpath#booleans

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Thanks - that did it! Thought I was missing something very obvious.
Much appreciated!

Jul 25 '07 #3

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

Similar topics

13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
4
by: Victor Engmark | last post by:
When looking for a method to fetch unique elements and counting the number of occurences of each of them, I found quite a lot of gross examples of complex XSL. But after realizing the subtle...
2
by: Rainer Kugeland | last post by:
Two problems regarding coordinates: a) When I click in the screen then I can easyly find the element on the current corrdinates. But is there a way to find the elements which are behind the fist...
19
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or...
12
by: Lawrence Oluyede | last post by:
I've some problems with filtering out a specific element by the following xml snippet (is part of a bigger xml document): <entry> <link...
2
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
10
by: Andy Fish | last post by:
Hi, I would like to include extra "hidden" information in a generated HTML page that can be used by javascript functions. I realise that most browsers seem to ignore any tags and attributes...
7
by: stevewy | last post by:
I'm looking to manipulate/check the state of various checkboxes and radios in a form. Because I don't want to access all of the checkboxes in the form, only a specific section, I am trying to...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.