1 Reply Latest reply on Mar 30, 2007 12:51 PM by ann.fso

    Evaluating an XML expression within from within an XML node

      I would like to pass in an E4X expression from a node and evaluate that expression.

      For example, let's say the XML looks like this:


      <section id="a">
      <item id="1">
      <item id="2">
      <item id="3">
      <value calculated="true">{section.(@id=="a").item.(@id=="1").value + section.(@id=="a").item.(@id=="1").value}</value>

      I would then like to evaluate this from within Flex, displaying each of the values from the three items and evaluating the expression that lies in the third item.

      Note: this doesn't work... (but it's the idea... that is, to retrieve the expression from the XML and evaluate it)...

      public var xmlHUD:XML;

      <mx:Label text="{myXML.section.item.(@id=='3').value}"/>

      If successful, the label would then display the result from the express in item 3, which would be 5.3 (the result of 3.1 + 2.2).

      Any ideas?