hi I am searching the xml files from the file system using the dollowing query. Everything works fine except the following situation. If i have 2 xml files and one dosen have a specific element and other one has.
My condition in the query is if element is empty or null load the xml file[Is empty==true] case "Is Empty":
if(xvalue == "True")
{
_xmlFilter = _xmlFilter = _xmlFilter.And(x => x.Element(xname) == null || x.Element(xname).IsEmpty);
}
else
{
_xmlFilter = _xmlFilter.And(x => x.Element(xname) != null && (!string.IsNullOrEmpty(x.Element(xname).Value)));
}
If "Is Empty" == false it works fine.
But the first condition returns both the files. Any help? thanks in advance