FWIW, this is the closest I can get with a straight schema:
<xs:complexType name="MessageKeysType">
<xs:sequence>
<xs:element name="msg-key" type="xs:string"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ResponseType">
<xs:sequence>
<xs:element name="message-keys" type="MessageKeysType"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="response" type="ResponseType"/>
produces:
{"message-keys":{"msg-key":["input.incorrect","foo","bar"]}}
Any tricks I am missing to remove the need for the msg-key property?
thanks,
-Rob
On Aug 2, 2009, at 2:29 PM, Robert Koberg wrote:
> Hi,
>
> Is there a way to create an XML Schema so that the JAXB/Jersey JSON
> Response produces an array and the XML response produces data
> elements, e.g.
>
> {
> "message-keys": [
> "a.b",
> "c.d"
> ]
> }
>
> and
>
> <message-keys>
> <entry>a.b</entry>
> <entry>c.d</entry>
> </message-keys>
>
> Everything I am trying is giving me a space separated value.
>
> thanks for any help/hints,