Finding elements without specific descendants

M

mwebb415

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>
.
.
.
.
.
</root>

What I'd like to do is find <home> nodes that do not have the <aaa>,
<xxx> or <bbb> child elements. The source file has approximately 500
nodes in total, and I expect that the number of those that are missing
all three of the child elements to be in the single digits, but I have
to account for them. I'm generating a large XPath query and parsing
the file on the fly via PHP.

Any thoughts? Is this possible?

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top