Hi David
On 07/06/12 18:56, KARR, DAVID wrote:
I've seen various FAQs and examples about configuring the namespace prefixes 
used in Jettison output.  What I've tried hasn't made any difference.

I have a "package-info.java" that looks like this:
--------------
@XmlSchema(namespace = "http://www.example.com/schema/app/SomeThing/v1.0";,
            elementFormDefault = XmlNsForm.QUALIFIED,
            xmlns = { @XmlNs(prefix = "os", namespaceURI = 
"http://www.example.com/schema/app/SomeThing/v1.0";),
                      @XmlNs(prefix = "xs", namespaceURI = 
"http://www.w3.org/2001/XMLSchema";),
                      @XmlNs(prefix = "xsi", namespaceURI = 
"http://www.w3.org/2001/XMLSchema-instance";)})
// Use either FIELD or PUBLIC_MEMBER.  If you change it, you have to move the 
annotations.
@XmlAccessorType(XmlAccessType.FIELD)
package com.example.app.domain;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;
--------------

When I make the call, however, my output uses a "ns1" namespace prefix (instead of the 
"os" that I was trying to set it to).  Am I missing an association with the package?

I wonder if this blog can explain why the above declarations are ignored ?
http://hwellmann.blogspot.ie/2011/03/jaxb-marshalling-with-custom-namespace.html

Cheers, Sergey

--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to