• 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
XML decoding using a mapping file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML decoding using a mapping file


  • Subject: XML decoding using a mapping file
  • From: David Holt <email@hidden>
  • Date: Mon, 31 Mar 2008 15:35:08 -0700

I am attempting to decode the following return from a website and I am OH SO CLOSE :-)
This is the xml:
<?xml version="1.0"?><SearchResult> <Count>2</Count> <IdList> <Id>18326189</Id> <Id>18061844</Id> </IdList></SearchResult>

I am trying to get the list of IDs, but I can only get it as far as the array "IdList". In my HTML component, I am using two WOStrings to display the contents for testing and I get:

Count: 2 
Idlist: ({Id = ("18326189", "18061844"); })

Where/how can I specify that ID should just be an integer? I can't change the XML, that is fixed. The IdList tag is confounding my attempts to get an array of ID's because ID ends up being an array of integers the way I've mapped the XML.

The XML model file looks like this:

<model>

   <entity name="ca.cscw.SearchResult" xmlTag="SearchResult" ignoreUnmappedTags="YES">
     <property name="count" xmlTag="Count" />
     <property name="idlist" xmlTag="IdList" forceList="Yes"/>
   </entity>

 </model>

My class for the result is:

package ca.cscw;

import com.webobjects.foundation.NSArray;

public class SearchResult {

private String count;
private NSArray idlist;

public SearchResult() {
}

public String count() {
return count;
}

public void setCount(String count) {
this.count = count;
}

public NSArray idlist() {
return idlist;
}

public void setIdlist(NSArray idlist) {
this.idlist = idlist;
}
}

Thanks for reading this far!

David
 _______________________________________________
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: XML decoding using a mapping file
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Is Adding EOAttribute to EOEntity Thread Safe?
  • Next by Date: Re: XML decoding using a mapping file
  • Previous by thread: FW: DirectAction problem
  • Next by thread: Re: XML decoding using a mapping file
  • Index(es):
    • Date
    • Thread