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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:24:14+00:00 2026-05-27T11:24:14+00:00

I want to parse some large XML file using linq to XML but I

  • 0

I want to parse some large XML file using linq to XML but I don’t know how exactly can I do this.
I want to read all <name> tag that come after <dac> tag. I must mentioned I have many <name> tag in XMl file I just want to read that one come after <dac>. How can I do this using linq to xml?

Here is a simple sample of my XML file:
I want the code return me such value: (SSS, HHH, HHH Panel)

<?xml version="1.0" encoding="UTF-8"?>

<installationTree>
  <folder>
    <id>1</id>
    <name>Company</name>
    <full-path>Door List / Company</full-path>
    <nodes>
      <controller>
        <id>9</id>
        <name>9016 Panel</name>
        <description/>        
        <full-path>Door List / Company / 9016 Panel</full-path>
        <nodes>
          <dac>
            <isOneDoorController>false</isOneDoorController>
            <id>9</id>
            <name>SSS</name>
            <description/>
            <address>1</address>
            <active>true</active>
            <externalId>ID:9_20111123_121106</externalId>
            <mode>standard</mode>    

            <doorCodes/>
            <full-path>Door List / Company / 9016 Panel / SSS</full-path>
            <nodes/>
          </dac>
          <dac>
            <isOneDoorController>false</isOneDoorController>
            <id>10</id>
            <name>HHH</name>
            <description/>
            <address>2</address>
            <active>true</active>

            <doorCodes/>
            <full-path>Door List / Company / 9016 Panel / HHH</full-path>
            <nodes/>
          </dac>
        </nodes>
      </controller>
      <oneDoorController>
        <id>8</id>
        <name>HHH Panel</name>
        <description/>
        <serialnumber>00:06:8e:30:24:24</serialnumber>
        <timezone>Iran</timezone>
        <active>true</active>
        <docUpdater/>
        <nodes>
          <dac>
            <isOneDoorController>true</isOneDoorController>
            <id>8</id>
            <name>HHH Panel</name>
            <description/>
            <address>1</address>
            <active>false</active>            
            <doorCodes/>
          </dac>
          <full-path>Door List / Company / HHH Panel</full-path>
          <nodes/>
        </nodes>
      </oneDoorController>
    </nodes>
  </folder>
</installationTree>
  • 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-27T11:24:15+00:00Added an answer on May 27, 2026 at 11:24 am

    You need to load the XML document and write the statement suggested by @Henk Holterman.

    string file = @"c:\file.xml";
    XDocument doc = XDocument.Load(file);
    var names= doc.Root.Descendants("dac").Elements("name");
    
    foreach (var t in names)
       Console.WriteLine(t.Value); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I want to parse some xml but I don't know how I
I want to parse some XML-file in Qt, but that file is located at
I am using SAX to parse some large XML files and I want to
I've got some very large XML files which I read using a System.Xml.Serialization.XmlSerializer .
Let's say this page www.example.com/mypage returns some html that I want to parse in
I'm using domDocument to parse some HTML, and want to replace breaks with \n.
I have a large file (bigger then RAM, can't read whole at once) and
I want to build a parser for analyzing a large input file, but I
I want to parse some JSON data. I'm using James Newton-King's JSON.NET library .
I want to parse some HTML in order to find the values of some

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.