If one enters a For-Each Select loop, telling it to look for two particular tags, completed by using the loop or function (tag1 | tag2), then if one wishes to have a particular function performed on just one on the tags, say tag1 -- How do you get the context from the For-Each loop -- as the tag1 and tag2 are no longer recognized unless they are nested within each other? So you would need to have <tag1> <tag2></tag2><tag1> to be able to complete a function on tag 2 but then it would also apply it to the outer tag1 as well.
Is there anyway of avoiding this?
It sounds like the function that needs to be performed on tag1 should be separated from the function to be performed on tag2. If there is commonality between the two pieces of code, the code can be factored into separate functions.
Removing the distinction between tag1 and tag2 is what is causing the problem here.
Dig Deeper on Topics Archive
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.