spring-restdocs
spring-restdocs copied to clipboard
XmlContentHandler's pretty printing of undocumented content fails when Saxon is on the classpath
There seems to be an assumed dependency on Xalan in org.springframework.restdocs.payload.XmlContentHandler of spring-restdocs-core-2.0.3.RELEASE.jar.
Line 180 has this:
transformerFactory.setAttribute("indent-number", 4)
Saxon uses "indent-spaces" attribute for the same thing, so perhaps this should be:
try {
transformerFactory.setAttribute("indent-number", 4);
} catch (IllegalArgumentException e) {
transformerFactory.setAttribute("indent-spaces", 4);
}
Otherwise,
.andDo(document("foo.xml", responseFields(...
throws IllegalArgumentException when Saxon-HE-9.8.0-8.jar is on the classpath.