1

i'm trying to view this rss feed :

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
  <channel>
    <Group>
      <Team>
        <teamID></teamID>
        <name></name>
      </Team>
      <Team>
        <teamID></teamID>
        <name></name>
      </Team>
    </Group>
    <Group>
     <Team>
        <teamID></teamID>
        <name></name>
      </Team>
      <Team>
        <teamID></teamID>
        <name></name>
      </Team>
    </Group>
  </channel>
</rss>

in a multiple tables using the xmlDatasource asp control and repeater control

i can only list all the teams of the document using this :

<asp:XmlDataSource ID="XmlDataSource1" runat="server" XPath="rss/channel/group/team"></asp:XmlDataSource>

and binding it to the repeater. or finding the groups only

<asp:XmlDataSource ID="XmlDataSource1" runat="server" XPath="rss/channel/group/team"></asp:XmlDataSource>

but i can't figure out how to find the children of the xpath . i mean if i used nested repeaters one for the groups and the other for the teams how to access the teams info .

4

1 回答 1

0
<asp:XmlDataSource ID="XmlDataSource1" runat="server" XPath="rss/channel/group/team"></asp:XmlDataSource> 

但我不知道如何找到 xpath 的孩子。

使用

rss/channel/group/team/*

team这将选择任何由 Xpath 表达式选择的 anu 子元素rss/channel/group/team

于 2012-08-06T12:34:09.353 回答