Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XPath -VBA (MSXML2 parses won't execute some Xpath strings) - no current context? XPath -VBA (MSXML2 parses won't execute some Xpath strings) - no current context?To: NULL Date: 12/1/2004 4:51:00 PM Initially, I tried to execute an XPath query with the selection language attribute not specifically set to XPath. (commented out) The result was that the XPath expression was flagged in parsing; Expected token 'EOF' found ":" child -->:<-- :advance Set the selection language attribute with a call???. The selection line execute, however, the list is empty. XPath selections which do not depend on the current node such as "//*" appear to work. A related question is how does one set the current node explicitly? I am using Word VBA (VB 6.3) with the MSXML 4.0 Service Pack 2 (Microsoft Core Services) installed. A listing of the data structure and program stub below. Thanks for any help you can give. <wrapper> <project> <advance> Solved a fundamental problem </advance> <uncertainty> Several alternatives, </uncertainty> <content> <step> First tried this. </step> <step> Second tried this. </step> <step> Third tried this. </step> </content> </project> <project> <advance> Solved a fundamental problem </advance> <uncertainty> Several alternatives, </uncertainty> <content> <step> First tried this. </step> <step> Second tried this. </step> <step> Third tried this. </step> </content> </project> </wrapper> Sub reportHTML(xmldoc As MSXML2.DOMDocument40) Dim elemlist As IXMLDOMNodeList, sublist As IXMLDOMNodeList Call xmldoc.setProperty("SelectionLanguage", "XPath") 'xmldoc.setProperty("SelectionLanguage","XPath") ' Gives syntax errors ' ' For all projects ' Set elemlist = xmldoc.SelectNodes("//project") For i = 0 To (elemlist.Length - 1) MsgBox ("hi fm the top " & elemlist.Item(i).nodeName) Set sublist = xmldoc.SelectNodes("child::advance") Call xSection(xmldoc, sublist) ... Next End Sub | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
