I have a fairly large repetitive XML to create using JAXB. Storing the whole object in the memory then do the marshaling takes too much memory. Essentially, my XML looks lik
The following did the trick for me:
XMLStreamWriter writer = ...
writer.setNamespaceContext(new NamespaceContext() {
public Iterator getPrefixes(String namespaceURI) {
return null;
}
public String getPrefix(String namespaceURI) {
return "";
}
public String getNamespaceURI(String prefix) {
return null;
}
});