Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Thread Tools Rate Thread Display Modes
Old 08-23-2006, 05: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")
myXpath = "//element[@attribute]"
Set nodes = doc.selectNodes(myXpath)

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

Thank You!
Reply With Quote
Old 08-23-2006, 10:45 PM
kinook kinook is online now
Join Date: 03-06-2001
Location: Colorado
Posts: 5,838
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).
Attached Files
File Type: bld xpath.bld (576 Bytes, 632 views)
Reply With Quote
Old 08-24-2006, 10:17 AM
Albert Albert is online now
Registered User
Join Date: 08-18-2006
Posts: 9
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!
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

All times are GMT -5. The time now is 08:46 AM.

Copyright 1999-2021 Kinook Software, Inc.