0 Replies Latest reply on May 2, 2007 1:05 AM by holla2040

    mxml e4x binding any descendant with @id == value

    holla2040 Level 1
      Folks,
      Here's my simple XML data
      d = XML
      <data>
      <test attr="testAttr">
      <value>1234</value>
      <value>5678</value>
      <value id='9'>9 value</value>
      </test>
      </data>

      I want to bind to the value element with id=9 without specifying the complete path. Here's what I've tried

      <mx:Text text="{d..(@id == 9)}" />
      <mx:Text text="{d..*.(@id == 9)}" />
      <mx:Text text="{d.descendants(@id == '9')} />

      I either have compiler errors or the binding returns nothing. Can anyone help?

      This example is simple. My actual xml data is quite large and I have no idea the paths to required elements. I do know the id's though. So I'd like to bind in mxml to XML elements by id but can't figure out the E4X syntax.

      Thanks.
      Craig