Posted on: 11/12/2014 12:47:00 AM | Views : 421

I have a method that validate XML based on XSD and output the error messages. I now the error messages are pretty much 1 string that each error message separated by line break. I want to return list of string that each element is one of the error messages. How can I make this?
these are my methods:
public string validateXML(string xml, string xsdFilePath, string currentSchema) { XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(currentSchema, xsdFilePath); settings.ValidationType = ValidationType.Schema; settings.ValidationEventHandler += new ValidationEventHandler(xmlSettingsValidationEventHandler); XmlDocument document = new XmlDocument(); XmlReader rdr = XmlReader.Create(new StringReader(xml), settings); while (rdr.Read()) ; return ErrorMsg; } public static v ...

Go to the complete details ...