Getting namespace of an @XmlType at runtime

iMage

New Member
I'm trying to output the \[code\]schemaLocation\[/code\] attribute properly when marshalling an \[code\]xjc\[/code\]-generated class instance. The root element class looks like: \[code\]@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "", propOrder = { "rootElement"})@XmlRootElement(name = "ROOTELEMENT")public class ROOTELEMENT { // Members}\[/code\]I see there's a \[code\]package-info.java\[/code\] class sitting in the package where all generated classes are, with the following contents: \[code\]@javax.xml.bind.annotation.XmlSchema( namespace = "http://my.own.namespace", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)package my.generated.classes.package;\[/code\]The answer to JAXB XJC code generation -
 
Back
Top