1 Reply Latest reply on Jan 2, 2008 12:15 AM by siki^2

    e4x single child issue

    cheezedaze
      Using httpservice I am receiving an xml that I will need to extract rows from, sometimes single rows, sometimes multiple rows. Nothing unusual. But when I try to extract a result with a single child rather than multiple children, it won't display anything. For example:

      The single child XML would look something like this:
      <content>
      <rowPageContent>
      <row MyText="This is a test sentence" />
      </rowPageContent>
      </content>

      The multiple child XML looks like this:
      <content>
      <rowPageContent>
      <row MyText="This is a test sentence" />
      <row MyText="This is a second test sentence" />
      <row MyText="This is a third test sentence" />
      </rowPageContent>
      </content>

      If I am to trace out the result after the httpservice call:
      trace(event.result.rowPageContent.row);

      muliple row tags traces:
      <row MyText="This is a test sentence" />
      <row MyText="This is a second test sentence" />
      <row MyText="This is a third test sentence" />
      Which is great... that's what it should do.

      single row tag diplays nothing.
      It should display:
      <row MyText="This is a test sentence" />
      But it displays nothing. No errors. Will not show anything. Ugh.

      Has anyone else ever encountered this? I'm running out of time and patience with this issue. Thanks!
        • 1. Re: e4x single child issue
          siki^2
          hi.. I've had similar issue with WS calls. I guess that the problem is somewhere in flex XML parsing. as I'm using the Object representation and thus there is no difference between XML attributes and child elements I've solved this issue by putting the MyText as a child element - eg.
          <content>
          <rowPageContent>
          <row>
          <MyText>This is a test sentence</MyText>
          </row>
          </rowPageContent>
          </content>