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?


    Requires Free Membership to View

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.


This was first published in February 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: