users@jaxb.java.net

Re: map namespace to packages

From: LD16 <dialazein_at_gmail.com>
Date: Wed, 18 Jun 2008 02:01:09 -0700 (PDT)

Hi Malachi,

Ho do you use this mapping then in Jaxb ? do you have a sample code?

I create a jaxbcontext from a package. i want to map this package
dynamically to a namespace as the namespace can change. Currently it works
with package-info.java class that has an annotation @XmlSchema(namespace
="http://..." ) but the annotation cant take a parameter.

Thanks

LD


Malachi de Ælfweald wrote:
>
> I do the following:
>
> 1. I map the xmlns/xsd to a package:
> <xsd:annotation>
> <xsd:appinfo>
> <jaxb:schemaBindings>
> <jaxb:package
> name="org.eoti.spec.gaea.common.v1"/>
> </jaxb:schemaBindings>
> </xsd:appinfo>
> </xsd:annotation>
>
> 2. If I want more than one package, I break it into more than one XSD (ie:
> a
> little more object oriented)
>
> 3. I use NamespacePrefixMapper
>
> Malachi
>
> On Fri, May 9, 2008 at 10:45 AM, Dovholuk, Clint <
> Clint.Dovholuk_at_globalcrossing.com> wrote:
>
>> Hi All,
>>
>>
>>
>> Is there a plugin or some switch I can pass to jaxb to allow me to map
>> namespaces to packages? Mapping schemas to packages is 'ok' but I'd
>> rather
>> a finer control over the mappings.
>>
>>
>>
>> Would a custom xjc plugin be able to accomplish this?
>>
>>
>>
>> Thanks,
>>
>> -Clint
>>
>
>

-- 
View this message in context: http://www.nabble.com/map-namespace-to-packages-tp17153205p17975430.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.