I just started switching my old DTD over to XSD when I found out about it, and I am wondering how I can enforce the XSD with my XML files? I have seen the W3C validator out there for it, but I wish that there was a way to make the program not run in the browser if an XSD error was found. Is that possible?
Share
Enforcing of XSD rules cannot be done directly within XML, as it is a textual file format and has not intrinsic logic or way to check itself for validity.
In order to enforce the rules, you need to use a validating parser – this parser can load the XML and XSD and check the XML for validity against the XSD. This is also true for DTDs.