On Apr 27, 6:17 pm, "John Saunders [MVP]" <john.saunders at
[quoted text, click to view] trizetto.com> wrote:
> "Paul" <paul.tho...@corpoflondon.gov.uk> wrote in message
>
> news:1177673309.150004.306880@t39g2000prd.googlegroups.com...
>
>
>
>
>
> > On Apr 26, 6:43 pm, "John Saunders [MVP]" <john.saunders at
> > trizetto.com> wrote:
> >> "Paul" <paul.tho...@corpoflondon.gov.uk> wrote in message
>
> >>news:1177579917.200702.246690@t39g2000prd.googlegroups.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 <configuration> or <appSettings> elements 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 :(