I have some XML (see snippet below) and I have got so far with it, but I don't know how to get at the text within the <Value> tags :
<ResponseGroup refID="AnswerGroup184">
<ResponseText refID="Textbox25">
<Value>Mike</Value>
</ResponseText>
<ResponseText refID="Textbox26">
<Value>P</Value>
</ResponseText>
<ResponseText refID="Textbox27">
<Value>Blue Orc</Value>
</ResponseText>
<ResponseText refID="Textbox28">
<Value>01234</Value>
</ResponseText>
<ResponseText refID="Textbox29">
<Value>m@p.com</Value>
</ResponseText>
<ResponseText refID="Textbox30">
<Value>1234</Value>
</ResponseText>
<ResponseText refID="Textbox31">
<Value />
</ResponseText>
</ResponseGroup>
Here is my code :
foreach (XmlElement rGroup in
doc.SelectNodes
("/df:ScriptedFaqSession/dfata/df:Section/df:ResponseGroup", mgr))
{
//contact details
if (rGroup.GetAttribute("refID") == "AnswerGroup184")
{
foreach (XmlElement rOption in rGroup.SelectNodes
("df:ResponseText", mgr))
{
if (rOption.GetAttribute("refID").ToString()
== "Textbox25")
{
}
}
}
}
What is the correct syntax to get the text within the <Value> tags?
<ResponseGroup refID="AnswerGroup184">
<ResponseText refID="Textbox25">
<Value>Mike</Value>
</ResponseText>
<ResponseText refID="Textbox26">
<Value>P</Value>
</ResponseText>
<ResponseText refID="Textbox27">
<Value>Blue Orc</Value>
</ResponseText>
<ResponseText refID="Textbox28">
<Value>01234</Value>
</ResponseText>
<ResponseText refID="Textbox29">
<Value>m@p.com</Value>
</ResponseText>
<ResponseText refID="Textbox30">
<Value>1234</Value>
</ResponseText>
<ResponseText refID="Textbox31">
<Value />
</ResponseText>
</ResponseGroup>
Here is my code :
foreach (XmlElement rGroup in
doc.SelectNodes
("/df:ScriptedFaqSession/dfata/df:Section/df:ResponseGroup", mgr))
{
//contact details
if (rGroup.GetAttribute("refID") == "AnswerGroup184")
{
foreach (XmlElement rOption in rGroup.SelectNodes
("df:ResponseText", mgr))
{
if (rOption.GetAttribute("refID").ToString()
== "Textbox25")
{
}
}
}
}
What is the correct syntax to get the text within the <Value> tags?