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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on XPath and XML File

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
I am using XPath to parse a large ACORD XML file and have the following line of code:

...
...
Doc.SetProperty "SelectionLanguage", "XPath"
For Each XXXXX In Doc.SelectNodes("/TXLife/xx/xx[@AppliesToPartyID = 'INS_1_L98047']")
...
...

My question is, I need to substitute a variable e.g. varC that would equal 'INS_1_L98047' instead of placing the literal in the code and I cannot figure out the syntax to get it to work. Any ideas or assistance on this would be appreciated.
 
I have discovered the correct syntax. What worked for me is:

Doc.SetProperty "SelectionLanguage", "XPath"
For Each XXXXXX In Doc.SelectNodes("/TXLife/xx/xx[@AppliesToPartyID = '" & varC & "']")
 
You helped me in parsing my ACORD XML file. Thanks mate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top