473,402 Members | 2,061 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.

Dealing with a null Namepsace in xmlDocument

When I submit my xmldocument to my web server it is adding in a namespace
with no namespace to the root which is preventing me from using an xpath on
the document. The xml submitted via soap to the web service looks like this:

<root xmlns="facts">
<mydata>.....</mydata>
</root>

I have used the namespacemanager thus, where sysFieldDoc is the xmldocument:

Dim myNamespace As XmlNamespaceManager = New
XmlNamespaceManager(sysFieldDoc.NameTable)
myNamespace.AddNamespace("", "facts")

but when I do sysFieldDoc.selectNodes("//ROOT",myNamespace).count I still
get nadda!!

Any thoughts or suggestions?

Cheers
Keith
Nov 12 '05 #1
1 870
Try:
Dim myNamespace As XmlNamespaceManager = New
XmlNamespaceManager(sysFieldDoc.NameTable)
myNamespace.AddNamespace("p", "facts")
sysFieldDoc.selectNodes("//p:root",myNamespace).count

Ion

"Keith Chadwick" <Ke***********@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
When I submit my xmldocument to my web server it is adding in a namespace
with no namespace to the root which is preventing me from using an xpath on the document. The xml submitted via soap to the web service looks like this:
<root xmlns="facts">
<mydata>.....</mydata>
</root>

I have used the namespacemanager thus, where sysFieldDoc is the xmldocument:
Dim myNamespace As XmlNamespaceManager = New
XmlNamespaceManager(sysFieldDoc.NameTable)
myNamespace.AddNamespace("", "facts")

but when I do sysFieldDoc.selectNodes("//ROOT",myNamespace).count I still
get nadda!!

Any thoughts or suggestions?

Cheers
Keith

Nov 12 '05 #2

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

Similar topics

3
by: schneider | last post by:
The DocumentElement is always null? and is readonly? How to I add node items to the root? I'm try to create a document from nothing. All the samples start by loading a string or file. ...
1
by: David C. allen | last post by:
I have created a simple Client-side SOAP Extension for a webclass that I have. When I apply the extension attribute to the the calling function in the proxy class I get an error 'Value cannot be...
13
by: Eric Lilja | last post by:
Hello, consider the following complete program: #include <assert.h> #include <ctype.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> static int...
20
by: Max Sandman | last post by:
I'm getting increasingly frustrated with C# and its exceptions on null values. Rather than try to deal with it on a hit-or-miss basis as exceptions pop up, I thought I should try to learn exactly...
8
by: Lenn | last post by:
Hello, Just some background: I'm developing an application that basically executes series of tasks. So far I have 2 group of tasks run on different threads (2 different threads). Which run in...
5
by: Stephen Cawood | last post by:
I'm trying to use a C++ .lib from C# (I tried the Interop group will no results). I have a working wrapper DLL (I can get back simple things like int), but I'm having issues dealing with an array...
3
by: Ganesh Palaniappan | last post by:
We're getting following exception for the below piece of code. We're wondering how it is possible since we're having a null check for objGraphics and strokePen... Exception:...
2
by: Simon Rigby | last post by:
Hi folks, A bizarre problem I am having. I have a treeview which is bound to an XmlDataSource. The XMLDataSource.Data property is set to the result of a function that generates an XML...
3
by: RC | last post by:
Let's say: if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { // Now I got an XML object here var xmlDocument = XMLHttpRequestObject.responseXML; // next I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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
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.