View Single Post
  #1  
Old 08-23-2006, 04:56 PM
Albert Albert is online now
Registered User
 
Join Date: 08-18-2006
Posts: 9
//element[@attribute] in vbscript

I'm trying to write a script that executes an xpath query that contains square brackets but I keep getting errors. The script works when tested in a .vbs file.

I think it has something to do with the [] brackets. I tried using the literal syntax using double brackets but it still produces an error. Is there any way to write this to get it to work in Visual Build Pro?

1st example:
Set doc = CreateObject("MSXML.DOMDocument")
doc.load(myfile.xml)
myXpath = "//element[@attribute]"
Set nodes = doc.selectNodes(myXpath)

2nd example:
myXpath = "//element[[@attribute]]"

Thank You!
Reply With Quote