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

Design time bug - [XmlDocument].selectSingleNode() - VS2005?

I have some code that loads and queries the web config file in the
design enviroment.

This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.

I am also able to traverse it using DocumentElement, FirstChild etc.

But if I attempt an XPath query to return a node I get a null.

Is this a known bug anyone?

Apr 26 '07 #1
5 2882
Paul wrote:
I have some code that loads and queries the web config file in the
design enviroment.

This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.

I am also able to traverse it using DocumentElement, FirstChild etc.

But if I attempt an XPath query to return a node I get a null.
What XPath are you using, how does the XML look?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 26 '07 #2
"Paul" <pa*********@corpoflondon.gov.ukwrote in message
news:11**********************@t39g2000prd.googlegr oups.com...
>I have some code that loads and queries the web config file in the
design enviroment.

This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.

I am also able to traverse it using DocumentElement, FirstChild etc.

But if I attempt an XPath query to return a node I get a null.

Is this a known bug anyone?
What is your XPath query? Are you using namespaces correctly?
--

John Saunders [MVP]
Apr 26 '07 #3
On Apr 26, 6:43 pm, "John Saunders [MVP]" <john.saunders at
trizetto.comwrote:
"Paul" <paul.tho...@corpoflondon.gov.ukwrote in message

news:11**********************@t39g2000prd.googlegr oups.com...
I have some code that loads and queries the web config file in the
design enviroment.
This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.
I am also able to traverse it using DocumentElement, FirstChild etc.
But if I attempt an XPath query to return a node I get a null.
Is this a known bug anyone?

What is your XPath query? Are you using namespaces correctly?
--

John Saunders [MVP]
John

It is a webconfig file.
The XPath is "//appSettings/add[@key='SQLConnectionString']"

This did work, and if I take the Xml out into XmlSpy and copy the
XPath I get the expected result.

I should also add that NO xpath seems to work.

Apr 27 '07 #4
"Paul" <pa*********@corpoflondon.gov.ukwrote in message
news:11**********************@t39g2000prd.googlegr oups.com...
On Apr 26, 6:43 pm, "John Saunders [MVP]" <john.saunders at
trizetto.comwrote:
>"Paul" <paul.tho...@corpoflondon.gov.ukwrote in message

news:11**********************@t39g2000prd.googleg roups.com...
>I have some code that loads and queries the web config file in the
design enviroment.
This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.
I am also able to traverse it using DocumentElement, FirstChild etc.
But if I attempt an XPath query to return a node I get a null.
Is this a known bug anyone?

What is your XPath query? Are you using namespaces correctly?
--

John Saunders [MVP]

John

It is a webconfig file.
The XPath is "//appSettings/add[@key='SQLConnectionString']"

This did work, and if I take the Xml out into XmlSpy and copy the
XPath I get the expected result.

I should also add that NO xpath seems to work.
Ok, you didn't answer my question about namespaces. Is there any chance that
the <configurationor <appSettingselements have namespace definitions on
them?

As to debugging this, are you saying that "/configuration" doesn't work?
"/*"?

--
John Saunders [MVP]
Apr 27 '07 #5
On Apr 27, 6:17 pm, "John Saunders [MVP]" <john.saunders at
trizetto.comwrote:
"Paul" <paul.tho...@corpoflondon.gov.ukwrote in message

news:11**********************@t39g2000prd.googlegr oups.com...


On Apr 26, 6:43 pm, "John Saunders [MVP]" <john.saunders at
trizetto.comwrote:
"Paul" <paul.tho...@corpoflondon.gov.ukwrote in message
>news:11**********************@t39g2000prd.googleg roups.com...
I have some code that loads and queries the web config file in the
design enviroment.
This worked happily pre-VS2005 and indeed is still able to load the
Xml into an XmlDocument object.
I am also able to traverse it using DocumentElement, FirstChild etc.
But if I attempt an XPath query to return a node I get a null.
Is this a known bug anyone?
What is your XPath query? Are you using namespaces correctly?
--
John Saunders [MVP]
John
It is a webconfig file.
The XPath is "//appSettings/add[@key='SQLConnectionString']"
This did work, and if I take the Xml out into XmlSpy and copy the
XPath I get the expected result.
I should also add that NO xpath seems to work.

Ok, you didn't answer my question about namespaces. Is there any chance that
the <configurationor <appSettingselements have namespace definitions on
them?

As to debugging this, are you saying that "/configuration" doesn't work?
"/*"?

--
John Saunders [MVP]- Hide quoted text -

- Show quoted text -
There are no namespaces that I am aware of, this is just a standard
webconfig file. Node is defined in the Xml as <appSettings>
And yes you are correct nothing seems to be working :(

May 2 '07 #6

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

Similar topics

2
by: Dave | last post by:
Hi, Is there an easier way to pull a subset of nodes from one XmlDocument to another? I have the code below but would like to know if there is a more streamlined method. Thanks, Dave ...
6
by: David Thielen | last post by:
Hi; I am calling SelectSingleNode("/xml/s:Schema/s:ElementType/@name") where "/xml/s:Schema/s:ElementType/@name is a legit xpath statement (xml is the name of the rootnode) and that xpath...
3
by: Marco Rizzi | last post by:
Hi all, i'm trying to add same node to XmlDocument. This is Xml that I want to create: <TableColumns> <TableColumn><Width>1.5in</Width></TableColumn>...
19
by: David Thielen | last post by:
Hi; If there are no namespaces this works fine for me. But if the xml has namespaces, then I get either no node back or an exception. Here is the sample xml: <root xmlns="http://www.test.org"...
4
by: Jesper Stocholm | last post by:
I have a database class that maintains data about customers i my system. The basic XML for this looks like: <Chunk> <Vendor> <Database/> </Vendor> </Chunk> When a user is to be registrered...
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...
4
by: Daniel | last post by:
Is it possible to use regular expressions inside of an xpath statement executed by System.Xml.XmlDocument.SelectSingleNode() ? string sdoc = "<foo><bar a='1'/><bar a='2'/></foo>";...
5
by: Alan Silver | last post by:
Hello, Sorry if this is an obvious question, but I'm not very familiar with using XmlDocument, and I am struggling with a really simple task. I couldn't find anything clear that explained what I...
1
by: =?Utf-8?B?RGF2aWRHQg==?= | last post by:
OK, so I've created and loaded an XMLDocument object. But how do I go about using it? Specifically, how do I: 1) move to the first node (I assume I start on it when I load the XML?) 2) move to...
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: 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...
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
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
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.