By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.