I need method like
public bool IsValid(string xmlText) {
// validation xml
}
I can write code like:
public bool IsValid(string xmlText) {
try {
XmlReader reader = XmlReader.Create(new StringReader(xmlText), settings);
while (reader.Read());
}
catch {
return false;
}
return true;
}
But I want write code without thrown exception. How I can do it?