The main difference between your code with XMLUnit und the one without is that XMLUnit uses javax.xml.validation.Validator rather than parsing the document. It seems as if Validator needs to know all Schema sources when validate is invoked and cannot pull in additional sources by itself unlike the SAXParser approach.
So it looks as if this was an all or nothing approach. Either you specify all of your schema sources or none. Unfortunately newSchema with an empty array of sources creates something different from the no-arg version.
I'll experiment a little but things may end up just getting documented.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
using svn revision 569 this seems to work if you do not specify a schema at all, I still need to document it, update the user guide and cut a new release.
I took your test project and had to perform a few modifications, in particual I had to add schemaLocations for http://schemas.xmlsoap.org/soap/envelope/ and ensured there is no schema source at all when you don't want to specify one.
It works with what will be XMLUnit 1.6 - and XMLUnit seems to find problems the parser approach doesn't detect, for example
KundeStandardService_v1.1-sucheKundeSoapRequest.xml; lineNumber: 8; columnNumber: 53; cvc-maxInclusive-valid: Value '1' is not facet-valid with respect to maxInclusive '0' for type '#AnonType_minorVersionCommonHeaderAttributesType'
(the line number is probably off due to my changes).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Somehow this issue never appeared on my radar, likely since it has been assigned to Jeff directly.
The main difference between your code with XMLUnit und the one without is that XMLUnit uses javax.xml.validation.Validator rather than parsing the document. It seems as if Validator needs to know all Schema sources when validate is invoked and cannot pull in additional sources by itself unlike the SAXParser approach.
I found this here http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi/index.html#N100D0
So it looks as if this was an all or nothing approach. Either you specify all of your schema sources or none. Unfortunately newSchema with an empty array of sources creates something different from the no-arg version.
I'll experiment a little but things may end up just getting documented.
using svn revision 569 this seems to work if you do not specify a schema at all, I still need to document it, update the user guide and cut a new release.
https://sourceforge.net/p/xmlunit/code/569/
Last edit: Stefan Bodewig 2014-12-09
I took your test project and had to perform a few modifications, in particual I had to add schemaLocations for http://schemas.xmlsoap.org/soap/envelope/ and ensured there is no schema source at all when you don't want to specify one.
It works with what will be XMLUnit 1.6 - and XMLUnit seems to find problems the parser approach doesn't detect, for example
KundeStandardService_v1.1-sucheKundeSoapRequest.xml; lineNumber: 8; columnNumber: 53; cvc-maxInclusive-valid: Value '1' is not facet-valid with respect to maxInclusive '0' for type '#AnonType_minorVersionCommonHeaderAttributesType'
(the line number is probably off due to my changes).
documented with svn revision 577.