0 Replies Latest reply on Nov 2, 2006 8:16 AM by Redunndancy

    Repeating XML in Tree Display

    Redunndancy Level 1
      I am using a Data Provider to load an xml file into a Tree structure. My xml file has repeating nodes of <container> and <product>, they are nested arbitrarily to reflect a proof of concept. When I load this file into a Tree structure I get repeating nodes, however in the original xml file, of course, these nodes do no appear.

      My call to load the xml into a XMLList through a Handler function is as follows:

      [Bindable]
      private var dishesDP:XMLList;

      private function dishesXMLHandler(event:ResultEvent):void
      {
      dishesDP = event.result..container;
      }


      The incorrect XML being loaded into my XMLList:

      <container title="Pants" description="These go on your legs">
      <container title="Jeans" description="They are blue and last a long time.">
      <product id="1" title="Levi's Denium" description="Nice normal blue jeans." price="17.50" image="image2.jpg"/>
      <product id="2" title="Abercombie" description="Did someone already wear these?? They got holes in them?" price="24.95" image="image2.jpg"/>
      </container>
      <container title="Slacks" description="Nice than jeans, wear them to work.">
      <product id="3" title="Dockers" description="Boring old people pants." price="14.95" image="image4.jpg"/>
      <product id="4" title="Old Navy" description="Cheap slacks, always got something slightly weird about them." price="18.75" image="image4.jpg"/>
      </container>
      </container>
      <container title="Jeans" description="They are blue and last a long time.">
      <product id="1" title="Levi's Denium" description="Nice normal blue jeans." price="17.50" image="image2.jpg"/>
      <product id="2" title="Abercombie" description="Did someone already wear these?? They got holes in them?" price="24.95" image="image2.jpg"/>
      </container>
      <container title="Slacks" description="Nice than jeans, wear them to work.">
      <product id="3" title="Dockers" description="Boring old people pants." price="14.95" image="image4.jpg"/>
      <product id="4" title="Old Navy" description="Cheap slacks, always got something slightly weird about them." price="18.75" image="image4.jpg"/>
      </container>
      ....


      The orginal (and correct) XML, existing in a remote file:

      <root>
      <container
      title="Pants"
      description="These go on your legs">
      <container
      title="Jeans"
      description="They are blue and last a long time.">
      <product
      id="1"
      title="Levi's Denium"
      description="Nice normal blue jeans."
      price="17.50"
      image="image2.jpg"
      />
      <product
      id="2"
      title="Abercombie"
      description="Did someone already wear these?? They got holes in them?"
      price="24.95"
      image="image2.jpg"
      />
      </container>
      <container
      title="Slacks"
      description="Nice than jeans, wear them to work.">
      <product
      id="3"
      title="Dockers"
      description="Boring old people pants."
      price="14.95"
      image="image4.jpg"
      />
      <product
      id="4"
      title="Old Navy"
      description="Cheap slacks, always got something slightly weird about them."
      price="18.75"
      image="image4.jpg"
      />

      </container>
      </container>
      ....


      The actually application link can be provided if necessary.

      Thank you for your time,

      Ryan