users@jersey.java.net

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

From: Paul Taylor <paul_t100_at_fastmail.fm>
Date: Mon, 23 Nov 2009 19:20:47 +0000

Tatu Saloranta wrote:
>> 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.
>
In a purest sense yes, but these days with so many applications out
there that scrape data from websites useing whatever tricks are
available and so many applications programmed by amateurs but still
fundamentally useful its a bit churlish to say they are fundamentally
broken , if they work they work however ithey achieve it.
> 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 +-
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>