I have a list of x people I am searching for in a SharePoint 2010 list. How do I build the or statement in XML similar to the if statement
if( person1 || person2 || person3 || ... personx)
Since every <Or>
has to have exactly 2 children, no more, no less, I have this so far:
query.InnerXml = "<Where>" +
"<Or>" +
"<Or>" +
"<Contains>" +
"<FieldRef Name=\"Member\" />" +
"<Value Type=\"Text\">" +
"Person1" +
"</Value>" +
"</Contains>" +
"<Contains>" +
"<FieldRef Name=\"Member\" />" +
"<Value Type=\"Text\">" +
"Person2" +
"</Value>" +
"</Contains>" +
"</Or>" +
"<Contains>" +
"<FieldRef Name=\"Member\" />" +
"<Value Type=\"Text\">" +
"Person3" +
"</Value>" +
"</Contains>" +
"</Or></Where>";
But I cant figure out a good way to make all the other or statements while looping through my list of x people