• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERRest - problem outputting xml as JSON object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERRest - problem outputting xml as JSON object


  • Subject: ERRest - problem outputting xml as JSON object
  • From: Elizabeth Lynch <email@hidden>
  • Date: Fri, 15 Jul 2011 12:11:02 +0100

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERRest - problem outputting xml as JSON object
      • From: Pascal Robert <email@hidden>
  • Prev by Date: Re: Strange behavior of com.webobjects.jdbcadaptor.MySQLPlugIn: Data truncated for column 'mailToInterviewer' at row 1
  • Next by Date: Re: ERRest - problem outputting xml as JSON object
  • Previous by thread: Re: Strange behavior of com.webobjects.jdbcadaptor.MySQLPlugIn: Data truncated for column 'mailToInterviewer' at row 1
  • Next by thread: Re: ERRest - problem outputting xml as JSON object
  • Index(es):
    • Date
    • Thread