0

申し訳ありませんが、同じような質問をもう一度します。次の XML ドキュメントを読み込もうとしています。

<markets currency="GBP">
  <market id="2908368" nextId="2908395">
    <status>ACTIVE</status>
    <commissionRate>2.5</commissionRate>
    <marketType>ANY_NUMBER_OF_WINNERS</marketType>
    <selections type="MainBets">
      <selection id="658442">
        <name>Player 1</name>
        <resource href="https://api.betfair.com/rest/v1/selection/tradeActivity
           ?username=sampleuser&marketId=2908368&selectionId=658442"
           responseType="selectionTradeActivity" title="Trade Activity"/>
        <status>IN_PLAY</status>   <!-- THIS IS THE VALUE I WANT -->
        <amountMatched>0.0</amountMatched> 
        <bestAvailableToBackPrices/>
        <bestAvailableToLayPrices/>
      </selection>
    </selections>
  </market>
</markets>

4 人のプレイヤーがそれぞれ欲しい値を持っていますが、各プレイヤーの個別のステータスではなく、同じステータスしか取得できません。誰か助けてください。大変感謝します

4

1 に答える 1

0

xpathを使用できます ここに例があります

 XmlDocument xmlDoc;
     XmlNode     xmlNode;
     String      xpathExpr;

     xmlDoc = new XmlDocument();
     xmlDoc.LoadXml( "<?xml version='1.0'?><root><person><name>Martin Fowler</name></person><person><name>Kent Beck</name></person><person><name>Dave Astels</name></person></root>" );

     xpathExpr = "/root/person[name='Martin Fowler']";
     xmlNode = xmlDoc.SelectSingleNode(xpathExpr);
于 2009-07-21T16:33:39.890 に答える