2 Replies Latest reply on May 6, 2011 3:45 AM by jonas345

    XML E4X Select nodes based on child node attribute.

    jonas345

      Hey,

       

      I am trying to make a selection on following XML.

       

      I want to retrieve a list of the variable node when its child nodes metadata attribute "name" is not equal to "transient". I have read through the documentation but have not been able to solve this and it should be rather simple. So far I have tried with something like.

       

      var variables:XMLList = classInfo.variable.(metadata.(@name != "transient"));

      var variables:XMLList = classInfo.variable.(metadata.@name != "transient");

       

      But it returns all variable nodes.

       

      <type name="com.sca.dataModel::PresentationDataEntity" base="com.sca.dataModel::BaseEntity" isDynamic="false" isFinal="false" isStatic="false">
        <extendsClass type="com.sca.dataModel::BaseEntity"/>
        <extendsClass type="Object"/>
        <variable name="subtitle" type="String">
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
            <arg key="pos" value="128"/>
          </metadata>
        </variable>
        <variable name="id" type="Number">
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
            <arg key="pos" value="153"/>
          </metadata>
        </variable>
        <variable name="tableName" type="String">
          <metadata name="transient"/>
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
            <arg key="pos" value="118"/>
          </metadata>
        </variable>
        <variable name="db_SortAsc" type="Boolean">
          <metadata name="transient"/>
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
            <arg key="pos" value="281"/>
          </metadata>
        </variable>
        <variable name="title" type="String">
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
            <arg key="pos" value="100"/>
          </metadata>
        </variable>
        <method name="setData" declaredBy="com.sca.dataModel::BaseEntity" returnType="*">
          <parameter index="1" type="Object" optional="false"/>
          <metadata name="__go_to_definition_help">
            <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
            <arg key="pos" value="330"/>
          </metadata>
        </method>
        <metadata name="__go_to_ctor_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="167"/>
        </metadata>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="42"/>
        </metadata>
      </type>