Skip to content

XML preamble customization #274

Description

@theseeker58

I'm trying to customize XML preamble. In particular I need to remove standalone flag.
These are the statements I'm using

        Marshaller marshaller = context.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "urn:iso:std:iso:20022:tech:xsd:pain.013.001.010 pain.013.001.10.xsd");
        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
        marshaller.setProperty("org.glassfish.jaxb.xmlHeaders", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        FileOutputStream out = new FileOutputStream(new File("src/test/resources/test.xml"));
        marshaller.marshal(document, out);

Everything works fine as long as I use a FileOutputStream.
Nothing happens when I use a StringWriter even though Writer is one of the classes allowed, according to documentation

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions