![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Simple XPath Question >Thread Next - Re: Simple XPath Question Re: Simple XPath QuestionTo: NULL Date: 7/6/2006 9:02:00 AM
"MKCline" <MKCline@h...> wrote in message
news:1152150603.737797.110600@l......
> I have a simple xml document and then a simple vbs script to test my
> searching.
>
> set xmlDoc=CreateObject("Microsoft.XMLDOM")
> xmlDoc.load("1.exe.config")
>
> set
> nodes=xmlDoc.selectNodes("//configuration/appSettings[add='test']/add")
> for each x in nodes
> MsgBox( x.xml )
> next
>
> If my file looks like this:
> <configuration>
> <appSettings>
> <add>test</add>
> <add ProductName="HostSync" ConfigFile="A.Config"></add>
> </appSettings>
> </configuration>
>
> it works..
> If I rearrange the items to look like this:
> <configuration>
> <appSettings>
> <add ProductName="HostSync" ConfigFile="A.Config"></add>
> <add>test</add>
> </appSettings>
> </configuration>
>
> it fails.
> If my 'searched' node isn't the first node it doesn't find anything.
> Can anyone assist me?
>
"//configuration/appSettings[add='test']/add[@ProductName]"
This specifies you want the add element which has a ProductName attribute
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
