public final String getMessage() {
JAXBContext jaxbContext;
StringWriter sw = new StringWriter();
try {
jaxbContext = JAXBContext.newInstance(Login.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty("jaxb.encoding", "ISO-8859-1");
jaxbMarshaller.marshal(this, sw);
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return sw.toString();
}
This is the code what I'm using..and I'm getting output as following.
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
Here I want to remove standalone="yes" and want output as
<?xml version="1.0" encoding="ISO-8859-1"?>
I checked link Remove 'standalone="yes"' from generated XML but answers here are removing complete
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
part
I don't want that.