ikorin24 / U8XmlParser

Extremely fast UTF-8 xml parser library
MIT License
96 stars 12 forks source link

Feature Request: Xml Validation #35

Open simon-curtis opened 2 years ago

simon-curtis commented 2 years ago

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

ikorin24 commented 2 years ago

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.