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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:01:08+00:00 2026-06-12T11:01:08+00:00

I am trying to extract those subnodes, but I had got just headache so

  • 0

I am trying to extract those subnodes, but I had got just headache so far…

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <supplyCrew xmlns="http://site.ddf.com">
     <login>
        <login>XXXX</login>
        <password>XXXX</password>
     </login>
     <flightInformation>
        <flights>
           <item>
              <arrivalDateTime>2010-11-08T22:48:00.000Z</arrivalDateTime>
              <arrivingCity>ORD</arrivingCity>
              <crewMembers>
                 <item>
                    <employeeId>020040</employeeId>
                    <isDepositor>Y</isDepositor>
                    <isTransmitter>N</isTransmitter>
                 </item>
                 <item>
                    <employeeId>09000</employeeId>
                    <isDepositor>N</isDepositor>
                    <isTransmitter>Y</isTransmitter>
                 </item>
              </crewMembers>
           </item>
           <item>
              <arrivalDateTime>2010-11-08T20:29:00.000Z</arrivalDateTime>
              <arrivingCity>JFK</arrivingCity>
              <crewMembers>
                 <item>
                    <employeeId>0538</employeeId>
                    <isDepositor>Y</isDepositor>
                    <isTransmitter>N</isTransmitter>
                 </item>
                 <item>
                    <employeeId>097790</employeeId>
                    <isDepositor>N</isDepositor>
                    <isTransmitter>Y</isTransmitter>
                 </item>

with the code I can get them, but I do not know how to select each one according to their tag name to insert them into a database.

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("C:/Crew_Request_Sample.xml"); 
XmlNodeList elemList = xmlDoc.GetElementsByTagName("item");
foreach (XmlNode node in elemList)
{
    Debug.WriteLine(node.InnerText);
}

I need some direction, please.

  • 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-12T11:01:09+00:00Added an answer on June 12, 2026 at 11:01 am

    The problem with using GetElementsByTagName("item") here is that there are 2 levels of item node – one as a child of flights and another item as a child of crewMembers.

    Edit Now that the full xml is pasted, it is clear that there is also a namespace involved as well. To handle namespaces, make use of a namespace manager to define aliases for the namespaces, which you can then use in the xpath queries:

    var nsm = new XmlNamespaceManager(xmlDoc.NameTable);
    nsm.AddNamespace("s", "http://site.ddf.com");
    var elemList = xmlDoc.SelectNodes("//s:crewMembers/s:item", nsm);
    foreach (var node in elemList)
    {
        Debug.WriteLine(node.SelectSingleNode("s:employeeId", nsm).InnerText);
        Debug.WriteLine(node.SelectSingleNode("s:isDepositor", nsm).InnerText);
        Debug.WriteLine(node.SelectSingleNode("s:isTransmitter", nsm).InnerText);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am actually trying to extract a Fat Disk Image with DiskUtils but I
Trying to extract strings that are wrapped in double brackets. For example [[this is
Trying to extract files to a given folder ignoring the path in the zipfile
im trying to extract some files from a jar-file downloaded using java-webstart. below code
Im trying to extract part of a line with perl use strict; use warnings;
I am trying to extract the facebook id from an iframe in order to
I am trying to extract the video id from a youtube url using the
I am trying to extract the page name from a complex url. This post
I'm trying to extract all of the links to image files from a text
I'm trying to extract all the unique characters from my utf-8 French dictionary file

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.