U8XmlParser icon indicating copy to clipboard operation
U8XmlParser copied to clipboard

Feature Request: Xml Validation

Open simon-curtis opened this issue 2 years ago • 1 comments

It would be great to have XmlValidation as part of this library using XmlSchemaSet.

Currently (using XDocument):

var schemas = new XmlSchemaSet();
schemas.Add("<namespace>", XmlReader.Create("<XsdLocation>"));
var xml = "<test></test>";

var doc = XDocument.Parse(xml);
doc.Validate(_schemas, ValidationCallBack);

private void ValidationCallBack(object? sender, ValidationEventArgs e) 
{
    ...
}

System.Xml.Schema.Extensions.Validate

I'm not sure how the api would look, but I would prefer a returned object from Validate instead of a callback

simon-curtis avatar Aug 03 '22 10:08 simon-curtis

Hi @simon-curtis

That's a good request, but unfortunately, I do not have the motivation to add new features. I am not familiar with XSD: XML Schema Definition Language, and it would take a lot of work to create that validation.

I have no plans to implement it at this time.

Thanks for using my library.

ikorin24 avatar Aug 19 '22 10:08 ikorin24