473,395 Members | 1,678 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,395 software developers and data experts.

Trouble with Xpath query

All,

I'm brand new to XML and have been given a deadline to deliver some new
functionality part of which requires stepping through an xml doc. I
have hit a wall with the way I've structured an xpath query to select
nodes from the xml and would be most appreciative of some assistance.
The beginning of the xml doc looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<ClliOutput xmlns="http://hobb.catalina.telcordia.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:schemaLocation="http://hobb.catalina.telcordia.com
//production//alltlsxml//schemas//clliOutput.xsd">
<clliHeader>
<returnCode>1</returnCode>
<message>CLONES CLLI found, and the LocateIt System found multiple
exact matches</message>
......
</ClliOutput>

This is the line that I know I just have not written correctly:
XmlNodeList addoutput =
xdoc.SelectNodes("ClliOutput/allAddrOrIntrscts/thisAddrOrIntrsct/AddressOutput/addrSegment");

Because it produces 0 when I write out addoutput.Count.ToString(), but
produces the expected number if I hand-edit the xml document and make
the document's root appear thus <ClliOutput> (stripping out all the
namespace references).

Many thanks in advance for advice!

Regards,
Monica

Nov 12 '05 #1
2 1120


me*****@comcast.net wrote:

<ClliOutput xmlns="http://hobb.catalina.telcordia.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:schemaLocation="http://hobb.catalina.telcordia.com
//production//alltlsxml//schemas//clliOutput.xsd">
<clliHeader>
<returnCode>1</returnCode>
<message>CLONES CLLI found, and the LocateIt System found multiple
exact matches</message> This is the line that I know I just have not written correctly:
XmlNodeList addoutput =
xdoc.SelectNodes("ClliOutput/allAddrOrIntrscts/thisAddrOrIntrsct/AddressOutput/addrSegment");


See
<http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/616>

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
Absolutely perfect! Thank you thank you thank you thank you so much!
Makes the 5 solid hours I spent yesterday poring through endless Google
Groups posts, MSDN, XML for dummies and god knows what else quite worth
it. Thank you Martin.

~Monica

Nov 12 '05 #3

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

Similar topics

6
by: 0wl | last post by:
Hi, I am trying to get the value of child from xmlstr = """<p:root xmlns:p="http://tempuri.org/string"><p:child DataType="String">Hellpppp</p:child></p:root>""" using...
8
by: Terry P | last post by:
Are there any tools (java classes, tag libraries) which can translate xpath statements into a SQL query? Given an xpath query which has a predicate that filters node values or attributes, I want...
3
by: gfrommer | last post by:
Hello Everyone, I'm writing a server in java, and I want the clients to pass me an XPath query. I want the XPath queries to be in a specific format though, I'm pretty sure it's valid but I want...
7
by: Ot | last post by:
I posted this to the wrong group. It went to m.p.dotnet.languages.vb. Ooops. -------------------------------------------------------------------- I have this tiny problem. I have learned...
10
by: Michael C# | last post by:
OK, here's the deal. I have a small XML file that represents a small database table. I load it into a System.XML.XMLDocument. So far so good. I run an XPath query against it to retrieve all the...
5
by: Gnic | last post by:
Hi , I have an XmlDocument instance, I want to find a node in the xml, but I don't know it's path until runtime, for example <aaa> <bbb name="x"/> <aaa attr="y"> <ccc>sometext</ccc> </aaa>
6
by: dotnetnoob | last post by:
i would like to know how i can build xpath expression dynamiclly. let's say i have a following xml file: <EventEnrollment InstanceNumber = "675"> <EventSource> <ObjectReference...
3
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml...
5
by: tschulken | last post by:
I have a query where i need to look for a value of a lower level xml element based on the value of a parent element existing first. Here is a simple example of the xml <S3Client> <Buttons>...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.