Skip to content

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

Open
@willredclef

Description

@willredclef

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.

Activity

changed the title [-]Xalan Dependency in XmlContentHandler?[/-] [+]XmlContentHandler's pretty printing of undocumented content fails when Saxon is on the classpath[/+] on May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wilkinsona@spring-projects-issues@willredclef

        Issue actions

          XmlContentHandler's pretty printing of undocumented content fails when Saxon is on the classpath · Issue #615 · spring-projects/spring-restdocs