Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

edit xmlns attribute with jaxb marshaller

package myproject.myapp;

import javax.xml.bind.*;

public class Demo {

    public static void main(String[] args) throws Exception {
        JAXBContext jc = JAXBContext.newInstance(RootElement.class);

        RootElement rootElement = new RootElement();

        Marshaller marshaller = jc.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.mysite.com/abc.xsd");
        marshaller.marshal(rootElement, System.out);
    }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #edit #xmlns #attribute #jaxb #marshaller
ADD COMMENT
Topic
Name
9+9 =