users@jaxb.java.net

Setting multiple namespaces on an element tag

From: Pratt, Jerald <jerpratt_at_northropgrumman.com>
Date: Thu, 06 Mar 2003 15:30:42 -0800

I'm trying to define multiple namespaces for my xml file output using JAXB.
I tried using the setProperty() method of the Marshaller class along with
Marshaller.JAXB_SCHEMA_LOCATION but this property only sets the
xmlns:schemaLocation attribute.
What do I need to use in order to define multiple/additional namespaces to
be used for an element tag? I don't really want to use the default tag
definition and I want to be able to define all my namespaces at the root tag
and not have them intersperse throughout the document.
For instance:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <a:aaa
xmlns:a="<http://www.bogus.com/aaa> xmlns:b="<http://www.bogus.com/bbb>
xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>> <b:bbb>test</b:bbb>
</a:aaa>
Jerald Pratt


*****************************
Jerald Pratt
Northrop Grumman IT
jerpratt_at_northropgrumman.com
(858) 621-5479
*****************************