users@jaxb.java.net

Re: Namespace Question

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 04 Feb 2003 15:40:26 -0800

> So I've switched to Apache's XMLSerializer. Now I've got more control
> over the output, but now I cannot for the life of me get the namespace
> prefixes off of the elements (the source code has not shed any light on
> this either -- I tried calling startPrefixMapping() before I call
> marshal(), but that had no effect).

Thanks for sharing your experience. It's good to know those details.


> Is this really the right way to be doing this?

I would consider that as more like a quick hack (pardon my expression),
since QNames can also appear in attributes and more importantly text
values.

But if you know that it works with your schema, I guess it's OK.

And I were you, I would probably try to modify David Megginson's
XMLWriter, as this is not a huge complicated component unlike
XMLSerializer. But perhaps you've already tried this.


> Is this something that will be fixed in the JAXB FCS?

I'm afraid not.


> Am I completely off my rocker for
> thinking that this should be a lot simpler than it has turned out to be?

I agree that it should be a lot simpler than that. The problem is that
we couldn't figure out the easy way, because of some arcane subtle issue
around QNames.


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com