I need to generate an XML document that starts like:
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance">
As such I have modified the package-info.java to be as followed:
@javax.xml.bind.annotation.XmlSchema( namespace = "urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"
, xmlns = { @javax.xml.bind.annotation.XmlNs( prefix="xsi"
, namespaceURI="http://www.w3.org/2001/XMLSchema-instance")
}
, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
)
package mypackage;
But the output is:
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
I'm not sure where to start looking as everything that everything that I find says to do exactly what I am doing...
UPDATE: I solved this by using MOXy as the JAXB implementation; code was OK, seems to be a problem with the implementation I was using :\