The only reason to set the Marshaller.JAXB_SCHEMA_LOCATION property is to have it appear in the XML that is marshalled. If you do not want it to appear then you need to not set that property.
UPDATE
because i have some specification where that property
xsi:schemaLocation= "Document.xsd" cannot be shown so final tag must
look like ; so far without any
success
Based on this comment, I believe you are looking for information on how to namespace qualify your model. Below is an example.
Java Model
package-info
@XmlSchema(
namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03",
elementFormDefault=XmlNsForm.QUALIFIED,
xmlns={
@XmlNs(prefix="", namespaceURI="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"),
@XmlNs(prefix="xsi", namespaceURI="http://www.w3.org/2001/XMLSchema-instance")
}
)
package forum20397718;
import javax.xml.bind.annotation.*;
Document
package forum20397718;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="Document")
public class Document {
}
Demo Code
Demo
package forum20397718;
import javax.xml.bind.*;
public class Demo {
public static void main(String[] args) throws Exception {
JAXBContext jc = JAXBContext.newInstance(Document.class);
Document document = new Document();
Marshaller marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(document, System.out);
}
}
Output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
For More Information
Marshallerproperty and then you ask how to remove it. What result are you trying to achieve? - bdoughan