users@jaxb.java.net

default namespace problem

From: hotwater <nabble_at_funfab.com>
Date: Tue, 19 Feb 2008 16:24:41 -0800 (PST)

I want a default namespace of http://www.adp.com/es/v1, but I get this:
<ns3:SyncBackgroundCheckOrder
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:ns3="http://www.adp.com/es/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

I implemented NamespacePrefixMapper and overrode getPreferredPrefix, to
specify "" for http://www.adp.com/es/v1, but it is ignored. (It does work
for the oa and xsi namespaces, however). I notice that the api says it is
not guaranteed that my specified prefix will be used. Why isn't it
guaranteed? How can I improve the odds?

I'm printing out the arguments to getPreferredPrefix, and the required flag
is false for www.adp.com, so I can't figure out why it won't use the default
namespace for it. Also, notice that third line below? The marshaller is
passing in an empty String? Is that part of the problem?

I'm using JAXB 2.1 with java 1.5. Please, please help!

 arg0 = http://www.openapplications.org/oagis/9, arg1 = null, arg2 = false
 arg0 = http://www.adp.com/es/v1, arg1 = null, arg2 = false
 arg0 = , arg1 = null, arg2 = false
 arg0 = http://www.w3.org/2001/XMLSchema-instance, arg1 = null, arg2 = false
 arg0 = http://www.w3.org/2001/XMLSchema-instance, arg1 = xsi, arg2 = true
 arg0 = http://www.adp.com/es/v1, arg1 = , arg2 = false
 arg0 = http://www.w3.org/2001/XMLSchema-instance, arg1 = xsi, arg2 = true

-- 
View this message in context: http://www.nabble.com/default-namespace-problem-tp15579623p15579623.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.