473,513 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SelectNodes not returning any nodes

I thought I knew XML but this just doesn't make sense.

I have a dataset ds. I load the data from the dataset into an XML document
and try to SelectNodes. Nothing.

Here is the code

Dim docMap As New XmlDocument()

Dim nodeList As XmlNodeList

docMap.LoadXml(ds.GetXml)

nodeList = docMap.DocumentElement.SelectNodes("/Mappings/Map")

Here is what I get when I do a ds.GetXml

<Mappings xmlns="http://emp.com/namespace">

<Map>

<HQuote>$INDU</HQuote>

<TC2000>dj-30</TC2000>

<Comment>Dow Jones Industrial Average (sm)</Comment>

</Map>

<Map>

<HQuote>DJI</HQuote>

<TC2000>dj-30</TC2000>

<Comment>Dow Jones Industrial Average (sm)</Comment>

</Map>

</Mappings>

Why do I not get any nodes?
Nov 20 '05 #1
1 2421
Hi Steve,

This is an Xml Default Namespace problem. Here's a thread we had here back in September that'll probably tell you more
about it than you want to know (if you follow the links given). (My answer was posted twice due to the newserver problems
at the time, so ignore the copy.)
http://tinyurl.com/u05m

Regards
Fergus

The TinyUrl is the equivalent of:

http://www.google.co.uk/groups?hl=en...d002449&seekm=
3f73d3b0%240%2421443%2448b97d01%40reader21.wxs.nl# link1
Nov 20 '05 #2

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

Similar topics

5
7374
by: Alexander Gnauck | last post by:
Hello, i have problems with the Namespaces and the .Net XML Parser My XML looks like this: <query xmlns="jabber:iq:roster"> <item jid="srlee@localhost" name="srlee"...
4
4825
by: Andrew Parsons | last post by:
Hey all, I have the following code to get a set of nodes containing a certain search criteria: theSearchTermsXML.selectNodes("/Table/Row/Cell") This works fine to a point - it finds all...
2
1746
by: Michael H | last post by:
Hello group, I have a some xml that looks like this below: <tuneRequests ct="3" xmlns:sql="urn:schemas-microsoft-com:xml-sql" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <tr...
4
4649
by: George | last post by:
XML Sample 1 : - <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSPY v5 U (http://www.xmlspy.com) by PHS Group plc (PHS Group plc) --> <EntityConfiguration...
2
4389
by: Joe | last post by:
Hello All: Does anyone know the differnce between the GetElementsByTagName method and the SelectNodes method? I know that they take different arguments. They also both return a NodeList. I'm...
16
19934
by: PiotrKolodziej | last post by:
Hi I'am using SelectNodes method to find if node followed by string exists, and if so i going to select that node. Create doc i such a way: doc = new XmlDocument(); ...
3
2209
by: Woon Kiat | last post by:
I have this Xml file, bookstore.xml <Bookstore xmlns="http://www.book.com"> <Shelve index="1"> <Book name="Da Vinci Code" /> </Shelve> <Shelve index="2"> <Book name="The Holy Grail" />...
8
12061
by: Vikram Vamshi | last post by:
If I execute XmlNode.SelectNodes("some xpath query") and then use foreach to iterate over it. Will it guaratee that the order of nodes I get will be same as the order of nodes in the original xml...
3
10676
by: Ben | last post by:
Hi We have the XML Below <Products> <Item Code="1"> <PN>Name</PN> <PC>ProductCode</PC> <MC>Manufacturer</MC> ......
0
7269
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
7177
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
7394
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,...
1
7123
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
5701
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,...
1
5100
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...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.