title: Flex, <mx:Combobox> & XML: get xml node to specify's dataprovider
body: <p>I'm trying to set a combobox's dataprovider.
  I have 2 comboboxes: cb_div and cb_stores.
  For cb_div, I get to set the data provider correctly with an XML file.
  Cb_stores' dataprovider is to be set depending on the selected item of cb_div.</p>
  
  <p>First, here are my XML files.
  Data provider for cb_div:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;divisions&gt;
   &lt;division id="Japan"&gt;Japan&lt;/division&gt;
   &lt;division id="Europe"&gt;Europe&lt;/division&gt;
  &lt;/divisions&gt;
  </code></pre>
  
  <p>Data provider for cb_stores:</p>
  
  <pre><code>&lt;list&gt;
   &lt;stores name="Europe"&gt;
    &lt;store&gt;BOUTIQUE HARROD'S&lt;/store&gt;
    &lt;store&gt;GALERIES LAFAYETTE LILLE&lt;/store&gt;
    &lt;store&gt;GALERIES LAFAYETTE SAISONNIERE&lt;/store&gt;
   &lt;/stores&gt;
   &lt;stores name="Japan"&gt;
    &lt;store&gt;ODEIS PACK HANZOMON&lt;/store&gt;
    &lt;store&gt;GINZA&lt;/store&gt;
    &lt;store&gt;OMOTESANDO&lt;/store&gt;
   &lt;/stores&gt;
  &lt;/list&gt;
  </code></pre>
  
  <p>What I'm trying to do is the following: if the user selects "Japan" in cb_div, the dataprovider of cb_stores should be the stores under <code>&lt;stores name="Japan"&gt;</code>, if he selects "Europe", the dataprovider should be <code>&lt;stores name="Europe"&gt;</code>.</p>
  
  <p>This is what I've done and it's not working: it returns every stores.</p>
  
  <pre><code>&lt;mx:Script&gt;
   &lt;![CDATA[
    import mx.controls.Alert;
    private function division_change():void
    {
     Alert.show(division.selectedItem.toString());
     var temp:XMLList = stores.stores.(@name=division.selectedItem);
     store.dataProvider = temp.store;
    }
   ]]&gt;
  &lt;/mx:Script&gt;
  &lt;mx:VBox verticalGap="10"&gt;
   &lt;mx:ComboBox id="division" dataProvider="{divisions.division}" change="division_change()" prompt=" "/&gt;
   &lt;mx:ComboBox id="store" prompt=" "/&gt;
   &lt;mx:TextInput id="password" displayAsPassword="true"/&gt; 
  &lt;/mx:VBox&gt;
  </code></pre>
  
  <p>Thanks for any help you can provide.</p>
  
  <p>Regards</p>