• 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
WOXMLCoder with mapping question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WOXMLCoder with mapping question


  • Subject: WOXMLCoder with mapping question
  • From: Kamal D Shah <email@hidden>
  • Date: Tue, 30 Dec 2008 17:56:37 +0530

Hi all,

I have an array of objects that I want to encode to XML. Let's say an array of departments. I need the XML to be generated to look like:

<depts>
<dept>
    <name>B</name>
    <description>BBBB</description>
</dept>

<dept>
    <name>A</name>
    <description>AAAA</description>
</dept>
</depts>
I am unable to get the <depts> and </depts> tags. I get only the inner XML.

I use a mapping file that looks like:

<model>
<entity name="com.webobjects.foundation.NSArray" xmlTag="depts">
<property name="com.webobjects.eocontrol.EOGenericRecord" xmlTag="dept"/>
</entity>


<entity name="com.webobjects.eocontrol.EOGenericRecord" xmlTag="dept">
<property name="name" xmlTag="name"/>
<property name="description" xmlTag="description"/>
</entity>
</model>

In my code, I have the following:

WOXMLCoder coder = WOXMLCoder.coderWithMapping(mapFilePath);

String responseXML = coder.encodeRootObjectForKey(depts, "depts");
where depts is an NSArray with the department objects (EOGenericRecords). What mistake could I be making?
Thanks a ton in advance...
Kamal



 _______________________________________________
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

  • Prev by Date: Re: Wonder into WO 5.3 Xcode Project
  • Next by Date: Re: Recording and looking up dates, when day-wide precision is required
  • Previous by thread: Re: [WOCommunity] WO Marketplace Survey: last reminder
  • Next by thread: Re: WOXMLCoder with mapping question
  • Index(es):
    • Date
    • Thread