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

XPath question - get all nodes that exist in all subnodes

Ok here is my XML structure :
<Files>
<File Name="One.txt">
<Client Name="test1">
<Errors>
<OtherErrorIDs>
<OtherErrorID>1</OtherErrorID>
<OtherErrorID>2</OtherErrorID>
<OtherErrorID>4</OtherErrorID>
</OtherErrorIDs>
</Errors>
</Client>
<Client Name="test2">
<Errors>
<OtherErrorIDs>
<OtherErrorID>1</OtherErrorID>
<OtherErrorID>3</OtherErrorID>
<OtherErrorID>5</OtherErrorID>
</OtherErrorIDs>
</Errors>
</Client>
</File>

<File Name="Two.txt">
<Client Name="test1">
<Errors>
<OtherErrorIDs>
<OtherErrorID>1</OtherErrorID>
<OtherErrorID>3</OtherErrorID>
<OtherErrorID>4</OtherErrorID>
</OtherErrorIDs>
</Errors>
</Client>
<Client Name="test2">
<Errors>
<OtherErrorIDs>
<OtherErrorID>2</OtherErrorID>
<OtherErrorID>3</OtherErrorID>
<OtherErrorID>4</OtherErrorID>
</OtherErrorIDs>
</Errors>
</Client>
</File>

Question is how to find the OtherErrorID that is present in all the clients
for a particular file
in the above eg it should return 1 for One.txt and 3 and 4 for Two.txt.

Can anyone point me in the right direction ?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET)
Microsoft Certified Application Developer (.NET)
http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
Nov 12 '05 #1
1 1651
Swanand Mokashi wrote:
Question is how to find the OtherErrorID that is present in all the clients
for a particular file
in the above eg it should return 1 for One.txt and 3 and 4 for Two.txt.


I'm not sure it can be done in pure XPath 1.0. XSLT - easily.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

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

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
2
by: David Gordon | last post by:
Hi Folks, I wonder if anyone can help me with the following (perhaps trivial) problem: <xml> <node name="a" type="a"/> <node name="b" type=""/> <node name="c"/> <node name="d" type="b"/>...
7
by: Gary McGill | last post by:
Suppose I have an xml file that looks like this: <example> <foo id="1"> <bar id="a1"/> <bar id="b1"/> ... </foo> <foo id="2"> <bar id="a2"/>
2
by: Neil | last post by:
I'm trying to get a list of nodes using the XMLNodeList.SelectNodes( xpath ) method. I want a list of criteria nodes where the attribute notModifiable is false or doesn't exist. Anyone know how to do...
5
by: Chua Wen Ching | last post by:
Hi, I read from this tutorial at codeproject Question A: http://www.codeproject.com/csharp/GsXPathTutorial.asp regarding xpath.. but i try to apply in my situation, and can't get it...
13
by: David Thielen | last post by:
XPathNavigator nav = MyCreateNav(); // InnerXml == "software" nav.SelectSingleNode"."); The select returns an exception: + $exception {"'.' has an invalid token."} System.Exception...
3
by: ziggyware | last post by:
Hi All, I have updated my XPath Generator software: XPath Studio .NET. ( http://www.ziggyware.com/downloads.php?cat_id=2 ) Easily select nodes from an xml file to generate XPath statements ...
1
by: Hapsdog | last post by:
Hi, I have the following XML: <a> <b> <c name="bob"/> <c name="billy"/> </b> <b>
2
by: Candle | last post by:
I am new to XML Programming and I am hoping someone can help me out with this. Assuming I have the following XML: <root> <E C="P_E1" O="E1" Y='True'> <A C="P_E1A1" V="7" Y='True'/> <A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.