我的应用程序中有来自 Web 服务的 xml 数据,其输出如下所示:
<?xml version="1.0" encoding="UTF-8"?>
-<NewDataSet>
-<Table>
<RecipeID>12923</RecipeID>
<RecipeNumber>R-000023</RecipeNumber>
<Name>Orange Pineapple Honey chicken (2)</Name>
<Servings>4</Servings>
<PrepTime>20</PrepTime>
<CookTime>90</CookTime>
<MarinateTime>0</MarinateTime>
<StandTime>0</StandTime>
<ChillTime>0</ChillTime>
<BrewTime>0</BrewTime>
<FreezeTime>0</FreezeTime>
<TotalTime>110</TotalTime>
<MethodHeader>Makes 4 servings</MethodHeader>
<SubTitle>Tasty variation of the delicious honey chicken with an orange pineapple sauce.
</Table>
-<Table1>
<Description>3 lbs. skinless boneless chicken breast halves</Description>
</Table1>
-<Table1>
<Description>2 Tbsp. salt</Description>
</Table1>
-<Table2>
<Note>Preheat oven to 350°F. Thoroughly wash chicken breasts and add salt.</Note>
</Table2>
-<Table2>
<Note>Place the salted chicken breasts in a large baking dish and set them aside. To make the sauce, combine the honey and the pineapple juice.</Note>
</table2>
</NewDataSet>
因此,我使用 ReadXml 将其放入数据集中,并通过
<%#Eval("RecipeID")%>
在我的母版页源中使用 inside 等方法在 DataList 中显示信息。
问题是当我到达<table1>
. 我无法获得多个节点(鸡肉和盐)。我怎样才能获取这两个节点。所以我可以继续在<table2>
哪里我也做同样的事情并获得两个<note>
节点