mojohaus / xml-maven-plugin

XML Maven Plugin
https://www.mojohaus.org/xml-maven-plugin/
Apache License 2.0
23 stars 21 forks source link

No validation is performed for ValidationSets without any publicId or systemId #31

Closed rosslamont closed 7 years ago

rosslamont commented 7 years ago

This should probably be an error condition, but a better solution would be to allow the validation to be inferred from each xml file using XSI information if available.

Unfortunately this might result in backward compatibility issues.

Perhaps the validation set should be required to have at least one of publicId, systemId or schemaLanguage. publicId or systemId would work as currently, if only schemaLanguage were provided, then the plugin would use the special zero arg Schema constructor on SchemaFactory.

jochenw commented 7 years ago

I think, we should be particularly clear in the distinction between DTD, and Schema. As it is, JAXP does either support the SAXParser(Factory).setValidating(boolean) method, which enforces the presence of a DTD, or the use of an XML (or other) schema. When I wrote the plugin, I wasn't aware of that distinction, so it isn't present in the parameters. In retrospect, it clearly should. As soon as we have tht distinction, I am more than open for new error conditions.