Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XPath - Syntax

Status
Not open for further replies.

week

MIS
Feb 14, 2001
118
0
0
US
I have a stmt below in my code which works fine.

Set sel = xmlDoc.selectNodes("//T3/Layer[@ID='AL']")

The problem is that 'AL' needs to be some variable like

Set sel = xmlDoc.selectNodes("//T3/Layer[@ID=lcState]")

Obviously it doesn't like it when I do that. I searched few different web sites to see how I can do that but I haven't seen any examples. I tried many different ways but was unsuccessful. Does anyone know how to do it?

Thanks.
 
does

Set sel = xmlDoc.selectNodes("//T3/Layer[@ID=" & lcState & "]")

work, where lcState='AL'

just a guess, ive never used this syntax before!!

good luck!


If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
 
Good guess... I had to make the variable lcState to have quotes but it works now. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top