users@jersey.java.net

Re: [Jersey] Json output not always matching xml output

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Mon, 23 Nov 2009 10:48:39 -0800

> Sure, but they are important for backwards compatability, the  reason they
> are important is the XML is returned in response to a publicably available
> REST queries, and some of the applications that process this might do it in
> quite a simplistic way, i.e simple text search looking for an element called
> ext:score. Seeing as these namespaces are defined in the XSD it really would
> be better if JAXB took advanatge of that rather than ignoring these
> namespace prefixes.

Still, such applications are fundamentally broken. Anything that puts
significance to XML namespace prefixes is broken by definition, with
just one exception: DTDs are defined in terms of prefix/local-name
pairs, so DTD validation unfortunately requires stable namespace
prefixes.

I think it would be nice to retain namespace prefixes, so if it is
easy to do, sure. I just would not want much energy to be spent on
supporting bad code. That just encourages developers to keep on
writing broken systems; and uses resources that could be used more
productively elsewhere.

Just my 2c,

-+ Tatu +-