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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:57:42+00:00 2026-05-17T20:57:42+00:00

What is a good way to read this XML? Or maybe I can structure

  • 0

What is a good way to read this XML? Or maybe I can structure the XML differently.

What I want is the process to be the main thing and then you could have any number of related process to follow.

  <Job>
    <Process>*something.exe</Process>
    <RelatedToProcess>*somethingelse.exe</RelatedToProcess>
    <RelatedToProcess>*OneMorething.exe</RelatedToProcess>
  </Job>

I am currently using a XmlNodeList and reading the innertext and then splitting the string on * but I know there has to be a better way.

  • 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-17T20:57:43+00:00Added an answer on May 17, 2026 at 8:57 pm

    Try this console app:

    class Program
    {
        public class Job
        {
            public string Process { get; set; }
            public IList<string> RelatedProcesses { get; set; }
        }
        static void Main(string[] args)
        {
            var xml = "<Job>" +
                        "<Process>*something.exe</Process>" +
                            "<RelatedToProcess>*somethingelse.exe</RelatedToProcess>" +
                            "<RelatedToProcess>*OneMorething.exe</RelatedToProcess>" +
                          "</Job>";
            var jobXml = XDocument.Parse(xml);
    
            var jobs = from j in jobXml.Descendants("Job")
                        select new Job
                        {
                            Process = j.Element("Process").Value,
                            RelatedProcesses = (from r in j.Descendants("RelatedToProcess")
                                                select r.Value).ToList()
                        };
    
            foreach (var t in jobs)
            {
                Console.WriteLine(t.Process);
                foreach (var relatedProcess in t.RelatedProcesses)
                {
                    Console.WriteLine(relatedProcess);
                }
            }
    
            Console.Read();
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read this already: The Best Way to shred XML data into SQL Server
Folks, Please, what's a good way of writing really big XML documents (upto say
What is a good way to persist querystring values in asp.net mvc? If I
What would be a good way to determine if a string contains an IPv4
XmlAttributeOverrides is a good way to override some attributes for serialization. MSDN says: You
What's a good way to check if a package is installed while within a
Is there any good way of truncating text with plain HTML and CSS, so
Is there a good way in asp.net MVC to trace ModelState errors? IsValid returns
Is there a good way to get the debug information that Django provides when
Does anyone have a good way of deleting duplicate transactions (same date, amount, biller,

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.