Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   //element[@attribute] in vbscript (https://www.kinook.com/Forum/showthread.php?t=2016)

Albert 08-23-2006 04:56 PM

//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!

kinook 08-23-2006 09:45 PM

1 Attachment(s)
The attached sample works ok here (outputs the text of the step elements in the current project). Note that in the Script code field of a Run Script action, brackets don't need to be doubled since the entire field is already expected to be script code (brackets denote script expressions in other fields).
http://www.visualbuild.com/Manual/runscript.htm
http://www.visualbuild.com/Manual/scriptexpressions.htm

Albert 08-24-2006 09:17 AM

Thank you for always replying so promptly to all of my posts. Here's something wierd. I came in this morning and I no longer get the errors. The script now works fine. I don't understand it and I won't question it.

Thank you for all your help!


All times are GMT -5. The time now is 05:47 AM.


Copyright © 1999-2023 Kinook Software, Inc.