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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:31:52+00:00 2026-06-15T17:31:52+00:00

I have this xml file which contains information from tagchimp, but the file contains

  • 0

I have this xml file which contains information from tagchimp, but the file contains way to much information. How do i only load the information i need. I have found some code:

XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("movie");

foreach (XmlNode node in nodes)
{
    string date = node["tagChimpID"].InnerText;
    string name = node["locked"].InnerText;
    Console.WriteLine("Id:" + date + " Locked:" + name);
} 

but it only loads the elements not the child elements, some for example movieTitle or shortDescription

I found a way:

public static string Test(string path, XmlElement nodes)
    {
        string Name = "";
        string releaseDate = "";
        XmlNodeList xnList = nodes.SelectNodes("/items/movie");
        XmlNode eNode;
        foreach (XmlNode xn in xnList)
        {
             eNode = xn.SelectSingleNode("movieTags/info/movieTitle");

            if (eNode != null)
            {
                Name = eNode.InnerText;
            }


           eNode= xn.SelectSingleNode("movieTags/info/releaseDate");
                releaseDate = eNode.InnerText;
        }

but it’s not the most practical way to come by it.

  • 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-15T17:31:53+00:00Added an answer on June 15, 2026 at 5:31 pm

    Since you are using .NET, you might spend some time learning LINQ to XML, since it sounds like it would do what you want.

    There is a lot of online documentation, in particular how to do various basic queries to get information from specific nodes: http://msdn.microsoft.com/en-us/library/bb943906.aspx

    You could also get the same results with XPath.

    Or you could manually traverse the nodes, although you would have to handle the child nodes properly (as you already discovered).

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

Sidebar

Related Questions

I have an XML file ( XML file I produce ) which contains information
i have xml file which contains CDATA i need to update the CDATA as
I have this xml file which has text init. i.e Hi my name is
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have this code that reads from XML file. It gets five strings (groupId,
I have an application that generates a lengthy Xml output file which contains many
I have a load of XSLT from a third party which i need to
I have an XML file which contains lists of stores, a simplified version is
I have an XML file which contains text with some very simple layout constructs:
I'm trying to build an unordered list from an existing XML file which contains

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.