Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7610451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:25:15+00:00 2026-05-31T01:25:15+00:00

I have the following XML: <questions> <question text=This is a test question?> <answer value=Yes>

  • 0

I have the following XML:

<questions>
<question text="This is a test question?">
<answer value="Yes">
 <requirement articleId="2899"/>
</answer>
<answer value="No">
  <requirement articleId="2899"/>
</answer>
</question>
</questions>

And I have the following markup in my ASPX page:

<asp:Repeater ID="rptQuestions" runat="server" DataSourceID="xdsQuestions">
<ItemTemplate>
    <p>
        <asp:Label ID="lblText" runat="server" Text='<%# Eval("text") %>' />
    </p>
    <div>
        <asp:RadioButtonList ID="rblAnswers" runat="server" RepeatDirection="Horizontal"
            RepeatLayout="Flow" AutoPostBack="true" OnSelectedIndexChanged="rblAnswers_SelectedIndexChanged"
            DataSource='<%# XPathSelect("answer") %>' DataTextField="value" DataValueField="value" />
    </div>
</ItemTemplate>
</asp:Repeater>
<asp:XmlDataSource ID="xdsQuestions" runat="server" DataFile="~/App_Data/QA.xml"
XPath="./questions/question" />

So far the only way I’ve been able to get this to work is to move the ‘value’ attribute of the ‘answer’ node into the element (like this: <value>Yes</value>) and bind to the ‘InnerText’ property of the ‘answer’ node, since XPathSelect is returning a collection of XmlElement. This is not how I want to go about it, because if any of the other child nodes of ‘answer’ (such as the ‘requirement’ node) also has InnerText, it gets concatenated along with ‘value’ in the ListItems of the RadioButtonList.

Any suggestions on how to bind my RadioButtonList without changing the XML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:25:17+00:00Added an answer on May 31, 2026 at 1:25 am

    Inside your RadioButtonList, change your DataSource to the following:

    DataSource='<%# XPathSelect("answer/@value") %>'

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to following XML document structure: <option_set id=1> <option>Yes</option> <option>No</option> <option>Maybe</option> </option_set> <question
I have a question. My input XML looks like <?xml version=1.0 encoding=UTF-8?> <Text> <Message>this
Following on from my recent question regarding parsing XML files in Java I have
My question is the following. I have xml that is versioned by a namespace.
I have the following XML example <?xml version=1.0?> <test> <items> <item>item 1</item> <item>item 2</item>
I have the following XML document: <x> <a>Some text</c> <b>Some text 2</b> <c>Some text
I just can't find a simple answer to this simple question I have from
This is going to be a bit lame question. I have the following code:
I have transformed an XML file See this question for a complete description What
I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.