omdb
5 Aug 2007, 4:49 AM
Hi there,
I'm using a ComboBox with an XmlReader to fetch data for a livesearch. Here is what my xml looks like:
<results>
<hits>1</hits>
<person>
<id>1461</id>
<name>George Clooney</name>
<jobs>
<job id="15">Actor</job>
<job id="16">Producer</job>
</jobs>
</person>
</results>
Now I'm trying to display all jobs of George in my ComboBox Template and can't find a way to collect all jobs. If I'm setting the mappings to {name: 'jobs', mapping: 'jobs/job'}, i will just get the first record, but not all.
If I'm trying to use a mapping to {name: 'jobs', mapping: 'jobs'} with a converter function, the converter just gets an empty string (understandable, as jobs doesn't have any value). But i would like to have a method, to get all child-elements to a coverter function, to build the value i want to display.
Is there any way, to map such a xml structure to a record?
Cheers,
Benjamin
I'm using a ComboBox with an XmlReader to fetch data for a livesearch. Here is what my xml looks like:
<results>
<hits>1</hits>
<person>
<id>1461</id>
<name>George Clooney</name>
<jobs>
<job id="15">Actor</job>
<job id="16">Producer</job>
</jobs>
</person>
</results>
Now I'm trying to display all jobs of George in my ComboBox Template and can't find a way to collect all jobs. If I'm setting the mappings to {name: 'jobs', mapping: 'jobs/job'}, i will just get the first record, but not all.
If I'm trying to use a mapping to {name: 'jobs', mapping: 'jobs'} with a converter function, the converter just gets an empty string (understandable, as jobs doesn't have any value). But i would like to have a method, to get all child-elements to a coverter function, to build the value i want to display.
Is there any way, to map such a xml structure to a record?
Cheers,
Benjamin