Skip to content

Allow adding <?xml-stylesheet ...> declarations (Processing Instructions) #452

Description

@OndraZizka

Describe the solution you'd like
Allow adding to the resulting XML.

Usage example
I want to serialize Java POJOs to XML in Spring REST endpoint, but include XSLT reference so that the browsers render it as HTML.

Additional context
The only similar feature I found is a flag WRITE_XML_DECLARATION.

ObjectMapper mapper = builder.createXmlMapper(true).build();
    ((XmlMapper) mapper).enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION);
    return new MappingJackson2XmlHttpMessageConverter(mapper);
}

Activity

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

    3.2adding-declarationsIssues related to adding non-content declarations to XML output

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions