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 15:11:41 +0000

Paul Sandoz wrote:
> On Nov 22, 2009, at 11:00 AM, Paul Taylor wrote:
>>> How can I keep it as ext, or is the original xml wrong in some way
>>> (forgive me but despite some effort I havent got my head round the
>>> namespace syntax)
>>>
>>> Paul
>> Never mind, solved the issue with NamespacePrefixMapper
>>
>
> Note that namespace prefixes in XML documents are usually not
> important when processing the XML infoset produced from parsing an XML
> document unless:
>
> 1) those prefixes are referred to in text content or attribute values
> (e.g. QNames in content); or
>
> 2) producing canonical versions of XML documents for the purposes of
> signing.
>
> One can think of a prefix as a sort of short name reference to a
> namespace so that the namespace does not have to be referred to
> directly many times resulting in XML documents that are hard to read
> or write by humans.
>
> Paul.
>
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.

Paul