[xsd-users] Validation on save

Boris Kolpackov boris at codesynthesis.com
Tue Sep 7 10:01:31 EDT 2021


Javier Gutierrez <javier.gutierrez at web.de> writes:

> I have an XSD with different constraints, e.g.: key references, unique and
> enumeration. The XML instance document gets validated correctly when I load
> it, i.e. an exception is thrown when a constraint is broken. But how to
> perform validation when editing or saving? The serialization does not seem
> to invoke any validation. I cannot find a flag for it, am I missing
> something?

There is no support for validation during serialization in XSD (let
alone "when editing"). The best option would be to serialize
(potentially to a memory buffer, if performance is important) and
re-parse.



More information about the xsd-users mailing list