users@jaxb.java.net

Re: how to setup jaxb marshaller to generate the namespaces at the root node.

From: gold <dev_at_samizdatdigital.org>
Date: Tue, 07 Jun 2005 17:33:59 -0700

there's an example that comes with the jwsdp (jaxb/samples directory, i
think) called something like the namespace mapping example. i've used
that example to do just what you want. even better, you can use whatever
prefix you want, not just 'ns2'.

jon

Srinivasan Chikkala wrote:
> When I marshall the jaxb model that contains the elements with
> attributes of type javax.xml.namespaces.QName, the namespace prefix and
> the namespace uri is generated locally in the parent element. Is there a
> way to tell the marshaller to generate all the namespaces in the root
> element of the xml document?
>
> I am getting the marshalled xml like
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <services-info version="1.0" xmlns="http://java.sun.com/xml/ns/ns1">
> <services component="true">
> <provide endpoint-name="MyServiceEndpoint"
> interface-name="ns2:MyInterface" service-name="ns2:MyService"
> xmlns:ns2="http://www.example.org/myservice.wsdl"/>
> </services>
> </services-info>
>
> I want to get the xml like this
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <services-info version="1.0"
> xmlns="http://java.sun.com/xml/ns/my/ns1"
> xmlns:ns2="http://www.example.org/myservice.wsdl >
> <services component="true">
> <provide endpoint-name="MyServiceEndpoint"
> interface-name="ns2:MyInterface" service-name="ns2:MyService" />
> </services>
> </services-info>
>
>
> I am using jwsdp 1.5
>
>
> thanks,
> -chikkala
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>