Hi Liz,

already tried org.json.XML? That's what I use for similar tasks.

http://www.JSON.org/java/index.html

Maik


Am 15.07.2011 um 14:58 schrieb Elizabeth Lynch:

> Hi Pascal
> 
> Sorry, I didn't explain the problem clearly.  I am doing that already. The 
> problem is that it comes as a string in my JSON output, not as an object. 
> 
> Liz
> 
> Sent from my iPhone
> 
> On 15 Jul 2011, at 12:39, Pascal Robert <prob...@macti.ca> wrote:
> 
>> I think the best way would be to transform the XML to a Java object and 
>> transform that object back to JSON.
>> 
>>> I am building an ERRest application (read only), and am having a problem 
>>> with one field.  This field holds an xml string, which I need to embed into 
>>> the output from show and index actions; it will be consumed as json 
>>> (mainly; possibly only).
>>> 
>>> For example, I would like to receive:
>>> 
>>> {"name" : "A Record", "data" : { "fieldA" : "valueA", "fieldB" : "valueB" } 
>>> }
>>> 
>>> where the data attribute comes from:
>>> 
>>> <SomeElement FieldA="valueA"><FieldB>valueB</FieldB></SomeElement>
>>> 
>>> Or something similar to that.  I can use net.sf.json to do the conversion 
>>> directly, which produces satisfactory strings, but that doesn't cope with 
>>> the XML output format case, and I can't figure out how to pass it into my 
>>> JSON output.  If I do that with a String field, then obviously it is output 
>>> as a string value, not as a JSON object, which isn't what I want.
>>> 
>>> In short, the XML is a moderately complex object, which I need to output as 
>>> an object in the JSON format.
>>> 
>>> All ideas appreciated.
>>> 
>>> Liz _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
>>> 
>>> This email sent to prob...@macti.ca
>> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/maik%40selbstdenker.ag
> 
> This email sent to m...@selbstdenker.ag

-- 
Maik Musall
m.mus...@selbstdenker.ag
tel    +49 941 698484-35
fax    +49 941 698484-99
mobile +49 171 5576498

===================================

SELBSTDENKER AG - No Vision Too Far

Gesandtenstraße 10
93047 Regensburg

b...@selbstdenker.ag
http://www.selbstdenker.ag

Niederlassung:       Regensburg
Handelsregister:      Regensburg HRB 7860
Vorstand/CEO:         Stephan Fürnrohr
Vors. des Aufsichtsrates/Chairman of the board: 
Dipl. Betriebswirt (FH) Richard Sibinger







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to