users@jaxb.java.net

RE: Default Namespace in JAXB

From: Ted Poovey <tpoovey_at_uscentral.coop>
Date: Tue, 27 Jul 2004 08:06:58 -0500

Create you own and use it. Class is NamespacePrefixMapperImpl and

      marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",

                             new NamespacePrefixMapperImpl());

 

Thank you

 

Ted D. Poovey

Software Engineer III

U.S. Central

Phone : (913) 227-6106

Fax : (913) 227-6254

 

-----Original Message-----
From: Vishal.Manchanda_at_iflexsolutions.com
[mailto:Vishal.Manchanda_at_iflexsolutions.com]
Sent: Tuesday, July 27, 2004 1:43 AM
To: users_at_jaxb.dev.java.net
Subject: Default Namespace in JAXB

 

 

Hi,

I'm using JAXB.

In my xml I need default namespace to be shown after marshalling.

Like this

 

<msg xmlns="dnamespace" >

..................

...............

.

</msg>

 

 

I'm using my own NamespacePrefixMapperImpl

But it is automatically generating "ns1" as prefix whereas I do not
want any prefix

It is showing output as

 

<msg xmlns:ns1="dnamespace" >

..................

...............

.

</msg>

 

Please suggest how I can declare default namespaces using JAXB

 

 

 

Vishal Manchanda

 Associate Consultant , e-Solutions

    PrimeSourcing(tm)," Add Value Reduce Risk" The Global IT Services
business from i-flex

 i-flex Solutions Ltd-Mumbai

    Tel: 91-22-5668 5362 OR 91-22-28391909 xtn-5360

    Cell: 91-98925 20922

 www.iflexsolutions.com/services/services.asp

 Email: vishal.manchanda_at_iflexsolutions.com