You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2014/07/01 12:19:58 UTC

Re: dollar sign printed in json

Hi
On 30/06/14 22:38, Lambert, Michael wrote:
> I am extending an xsd string to include xml:language:
>
> <xsd:complexType name="reasonType">
> <xsd:simpleContent>
> <xsd:extension base="xsd:string">
> <!-- see http://www.ietf.org/rfc/rfc3066.txt for valid values -->
> <xsd:attribute ref="xml:lang" use="required" />
> </xsd:extension>
> </xsd:simpleContent>
> </xsd:complexType>
>
> But when i serialize it out into json i get an ugly '$' as the key to the
> string value. Anyway to change it so that the key is printed differently?
> "value" would be a better key name for me:
>
> {
>      "ce1.code": "BadArgument",
>      "ce1.reason": {
>          "$": "Bad argument error",
>          "xml.lang": "en"
>      }
> }
>
It appears JAXB reports "Bad argument error" as the 'mixed' content. 
Jettison marks it with '$'. Can you paste the code generated from the 
reasonType type only here ?

By the way, the attributes in XML namespaces do not have to be in a 
schema as far as I recall.

Cheers, Sergey

> Thanks!
>