Hi Mike,
Is there a way to specify the root level tag name? E.g. right now I've an
entity called Book, if I generate the xml using ERRest it generates as
following:
<Books>
<Book>...</Book>
<Book>...</Book>
</Books>
if I use ERXRest.pluralEntityNames=false the I get XML as following...
<Book>
<Book>...</Book>
<Book>...</Book>
</Book>
The issue with this approach is when I use NSXMLParser for my iPhone/iPad
application, in the didStartElement... event, this tag cause a little bit of
complexity to handle properly.
I was curious if we could possibly assign the root tag name as something called
"Root" or "Data" etc?
Thanks,
Farrukh
On 2010-07-04, at 8:05 PM, Mike Schrag wrote:
> I have no idea why you're getting spaces ... It should be using the
> englishLocalizer()'s plurifying. Do you maybe have localizations defined that
> map "MediaSection" to "Media Section"?
>
> I pushed the pluralization of the root node down into the rest format which
> can now be controlled by the property ERXRest.pluralEntityNames=false. This
> will also turn off the default pluralization on URLs, so you will want to
> construct your ERXRouteRequestHandler with the NameFormat explicitly if you
> want to retain plural urls.
>
> I suspect the spacing is some weird overlap between pluralization and display
> keys. Slightly tricky problem there if it is, because it's unclear the best
> way to fix that in the general case. It might make sense to declare a "Rest"
> language, so we don't inherit any normal overrides. I'll have to fiddle with
> that at some point.
>
> On Jul 4, 2010, at 3:54 AM, Farrukh Ijaz wrote:
>
>> Hi,
>>
>> I'm using ERRest Framework. I want to understand how the Plural names are
>> being picked up by the Framework.
>>
>> I've few entities as MediaDocument, MediaImage and MediaSection. I have
>> added them to the handler using addDefaultRoutes(?.ENTITY_NAME) method. I
>> don't know why the response is different in creating the parent tag.
>>
>> Following are the routes:
>>
>> /ra/MediaDocument -> MediaDocument
>> /ra/MediaImage -> MediaImage
>> /ra/MediaSection -> MediaSection
>>
>> For MediaDocument it uses <Documents type="MediaDocument">, for MediaImage
>> it uses <Images type="MediaImage"> and for MediaSection it uses <Media
>> Sections type="MediaSection">.
>>
>> For MediaSection, it is considered as Malformed XML as the tag name contains
>> space i.e. <Media Sections type="MediaSection">
>>
>> Am I'm missing some configuration?
>>
>> Farrukh
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com
>>
>> This email sent to [email protected]
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/farrukh.ijaz%40fuegodigitalmedia.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]