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 8453653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:49:09+00:00 2026-06-10T11:49:09+00:00

I have an XML DataSource which feeds a repeater control. However, I’m having some

  • 0

I have an XML DataSource which feeds a repeater control. However, I’m having some issues getting the actual data to be shown.

The XML DataSource contains a list of Thicknesses of materials (taken from a larger XML file), along with price, size and dimension data:

<Thickness>
  <Thick>
    <Size label="Thickness: 12"><![CDATA[12]]></Size>
    <Price>5778</Price>
    <From>0</From>
    <To>0</To>
  </Thick>
  <Thick>
    <Size label="Thickness: 22"><![CDATA[22]]></Size>
    <Price>5919</Price>
    <From>0</From>
    <To>0</To>
  </Thick>
  ...
</Thickness>

I load the DataSource with the following code:

myThickness.XPath = "/Item[@label='" + tvwMaterials.SelectedNode.Text + "']/Thickness/*";
myThickness.DataBind();

(The other XPath stuff is just to get to the Thickness stuff). I then attempt to load it into the repeater (which is databound to the XML DataSource) and display it using the following code:

<ItemTemplate>
    <table>
        <tr>
            <td><asp:Label ID="lblThickness" runat="server" Text="Thickness: " />
            <asp:TextBox ID="txtThickness" runat="server" Text='<%# XPath("Thick/Size") %>' />
        </tr><tr>
            <td><asp:Label ID="Label2" runat="server" Text="From: " />
            <asp:TextBox ID="TextBox1" runat="server" Text='<%# XPath("Thick/From") %>' />

         /tr>
    </table>
</ItemTemplate>

This correctly loads the number of controls, but the controls do not show any data. If I change the xPAth in the loading event to:

myThickness.XPath = "/Item[@label='" + tvwMaterials.SelectedNode.Text + "']/Thickness";

Then the controls do show data, but only for the very first record (12 and 0). I am not familiar enough with xPAth yet to figure out whteher the /* behind Thickness is needed or not, and if it is, how I then would copnstruct the xPAth in the repeater to read out the values. Anyone have any pointers, please?

Thanks in advance!

  • 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-06-10T11:49:10+00:00Added an answer on June 10, 2026 at 11:49 am

    Load it like this:

    myThickness.XPath = "/Item[@label='" + tvwMaterials.SelectedNode.Text + "']/Thickness/Thick";
    myThickness.DataBind();
    

    Your datasource path must refer the repeating element in the xml document.

    <ItemTemplate>
        <table>
            <tr>
                <td><asp:Label ID="lblThickness" runat="server" Text="Thickness: " />
                <asp:TextBox ID="txtThickness" runat="server" Text='<%# XPath("Size") %>' />
            </tr><tr>
                <td><asp:Label ID="Label2" runat="server" Text="From: " />
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# XPath("From") %>' />
    
             /tr>
        </table>
    </ItemTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView which is databound to an XML Datasource. For one of
I have an xml datasource which looks like this: <dsQueryResponse> <Department> <Rows> <Row dept=HR
I have a treeview which i populate dynamically using an XML Datasource. The leaf
I have a XML file which holds configuration data for data sources, and the
I have DataSource which is configured on Tomcat 6 in context.xml as MyDataSource. And
I currently have a datasource from a client in the form of XML, this
I have a TreeView that is bound to a XmlDataSource control. I've added some
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have an array which is converted from an XML response. What I need
On JBoss 5.1.0 I have Datasource (PostgreSQL 8.3.11) configured using *-ds.xml (standard jboss DS).

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.