1 Reply Latest reply on May 16, 2007 1:45 AM by netsesame

    dynamic xpath

    KUZELJ
      hi,

      i would like to dynamically create a xpath expression.
      (see my example)

      var user =
      <User>
      <Accounts type="LOAD">
      <Account id="007" name="james bond"/>
      </Accounts>
      <Accounts type="OTHER">
      <Account id="008" name="Goldfinger"/>
      </Accounts>
      </User>;

      var type_selector = "LOAD";
      var result = user.Accounts.(@type==type_selector).Account;

      the above i would like to yield => <Account id="007" name="james bond"/>.
      but it doesnt.

      i also tried => var result = user.Accounts.(@type=="{type_selector}").Account;
      no luck either.

      can anybody tell me the trick?

      ciao robertj