Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Xpath - selectSingleNode -[starts-with??` [Thread Next] Re: Xpath - selectSingleNode -[starts-with??`To: NULL Date: 10/1/2007 9:27:00 PM If it works with SelectNodes then it's the same with SelectSingleNode, which just delegates to SelectNodes and returns the first in the list. The Offset you specified was 2, not 5, the XPath should look like: /Offset/Dist/x[starts-with(., '2')] so make sure that's what you get my using a MsgBox or similar to display the final XPath before using it. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name "Dave F." <df@b...> wrote in message news:%23weak2EBIHA.4836@T...... > Martin Honnen wrote: >> Dave F. wrote: >> >>> Is there away to use starts-with with selectSingleNode? >> >> Yes, but with MSXML 3 you need to set >> MsDom.setProperty "SelectionLanguage", "XPath" >> first. Later MSXML version (e.g. 4/5/6) do support XPath by default. >> >> > > Thanks to both for your replies. > I'm using v4, so it must be a problem with the syntax. Which is what's > confusing me. > It returning just the first node it finds. I thought it returned a node > with all the test strings beginning with 5. > > You'll have to excuse me, I'm newish to XML/XPATH. & not sure what I'm > doing. > > Can you point me in the right direction? > > Cheers > Dave F. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
