all groups > dotnet xml > april 2007 >
You're in the

dotnet xml

group:

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


Re: Design time bug - [XmlDocument].selectSingleNode() - VS2005? Martin Honnen
4/26/2007 12:00:00 AM
dotnet xml:
[quoted text, click to view]

What XPath are you using, how does the XML look?

--

Martin Honnen --- MVP XML
Design time bug - [XmlDocument].selectSingleNode() - VS2005? Paul
4/26/2007 2:31:57 AM
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?
Re: Design time bug - [XmlDocument].selectSingleNode() - VS2005? John Saunders [MVP]
4/26/2007 1:43:46 PM
[quoted text, click to view]

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

John Saunders [MVP]

Re: Design time bug - [XmlDocument].selectSingleNode() - VS2005? Paul
4/27/2007 4:28:29 AM
On Apr 26, 6:43 pm, "John Saunders [MVP]" <john.saunders at
[quoted text, click to view]

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.
Re: Design time bug - [XmlDocument].selectSingleNode() - VS2005? John Saunders [MVP]
4/27/2007 1:17:11 PM
[quoted text, click to view]

Ok, you didn't answer my question about namespaces. Is there any chance that
the <configuration> or <appSettings> elements have namespace definitions on
them?

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

--
John Saunders [MVP]

Re: Design time bug - [XmlDocument].selectSingleNode() - VS2005? Paul
5/2/2007 12:16:16 AM
On Apr 27, 6:17 pm, "John Saunders [MVP]" <john.saunders at
[quoted text, click to view]

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 :(
AddThis Social Bookmark Button