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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:06:29+00:00 2026-05-16T23:06:29+00:00

I need to read a XML Spread Sheet 2003 in a project and I

  • 0

I need to read a XML Spread Sheet 2003 in a project and I have a problem with columns.

This example show you have king of template my data are :

Name Of | FirstName | SecondName | ... | ... 

Monday  |     1     |     2      |   3 |   2 

Tuesday |     0     |     1      |   1 |   ?

Wednesday |   2     |     ?      |   ? |   ?

I need to extract every data in each columns and the problem is here : C# read this XML Spread Sheet row by row only and with this example I don’t know how I can have exactly every data for each column. Moreover I can’t know in advance the data.

Here is the beginning of my code

var queryPeriodSheet = from worksheet in data.Descendants(ss + "Worksheet")
                               where worksheet.Attribute(ss + "Name").Value == "sheet1"
                               select worksheet;

var rows = from row in queryPeriodSheet.Descendants(ss + "Row")
select row;

…

I need your help,

Thank you

  • 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-16T23:06:30+00:00Added an answer on May 16, 2026 at 11:06 pm

    You need to look at the ss:Index attribute in each cell element in each row since there are no XML elements for empty cells.

    I use the following code to find text in a specific cell in a row:

        /// <summary>
        /// 
        /// </summary>
        /// <param name="rowElement"></param>
        /// <param name="cellIndex">0-based cell index.</param>
        /// <returns></returns>
        public string GetCellData(XmlElement rowElement, int cellIndex)
        {
            XmlNodeList cellElements = rowElement.SelectNodes("ss:Cell", xmlnsManager);
            if (cellElements != null)
            {
                int elementIndex = 0;
    
                foreach (XmlElement cellElement in cellElements)
                {
                    // Special case: cells can be skipped. If so, there is a ss:Index attribute that contains the 1-based index of the cell.
                    if (cellElement.HasAttribute("ss:Index"))
                    {
                        elementIndex = Convert.ToInt32(cellElement.GetAttribute("ss:Index")) - 1;
                    }
    
                    // If cell has been skipped.
                    if (cellIndex < elementIndex)
                        return null;
    
                    if (cellIndex == elementIndex)
                        return cellElement.InnerText.Trim();
    
                    elementIndex++;
                }
            }
            return null;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read a xml file, but I have this error when try
I need to simply read an .xml file; like this: <exchanges> <exchange> <timestamp>2010-08-19 17:15:56</timestamp>
I need to read XML data into lazarus, in order to present this data
need help to read xml file. i have one xml file which i want
I have to read xml file. I did it but i had a problem.
I need to read an XML file on a low memory system (don't have
Often I need to read big XML files (> 100 MB) which have a
I have xml-file. I need to read it, make some changes and write new
I have a very similar question to: LINQ to read XML I need to
I have a package with multiple java classes inside. I need to read xml

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.