Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XmlContentHandler's pretty printing of undocumented content fails when Saxon is on the classpath #615

Open
willredclef opened this issue May 6, 2019 · 0 comments

Comments

@willredclef
Copy link

willredclef commented May 6, 2019

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.

@wilkinsona wilkinsona changed the title Xalan Dependency in XmlContentHandler? XmlContentHandler's pretty printing of undocumented content fails when Saxon is on the classpath May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants