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

  • Home
  • SEARCH
  • 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 408247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:40:26+00:00 2026-05-12T17:40:26+00:00

I can’t understand why this NodeList is Empty XmlDocument document = new XmlDocument(); document.Load(xmlpath);

  • 0

I can’t understand why this NodeList is Empty

XmlDocument document = new XmlDocument();
document.Load(xmlpath);    
XmlNodeList nodes = document.SelectNodes("/StructureResponse/rootItem/attributes/Attribute");

Here the XmlFile

<?xml version="1.0" encoding="utf-8"?>
<StructureResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://nts-de-osm1-pxc/webservices/">
    <consolidatedItems xsi:nil="true" xmlns="http://systinet.com/wsdl/com/osm/webservices/service/" />
    <rootItem xsi:type="Part" xmlns="http://systinet.com/wsdl/com/osm/webservices/service/">
        <attributes>
            <Attribute>
                <dataDictionary xsi:nil="true" />
                <dataType>string</dataType>
                <displayName>IDENT_NR</displayName>
                <key>true</key><name>IDENT_NR</name>
                <searchable>true</searchable>
                <userAttribute>true</userAttribute>
                <value>9662744</value>
            </Attribute>
            <Attribute>
                <dataDictionary xsi:nil="true" />
                <dataType>string</dataType>
                <displayName>AI</displayName>
                <key>true</key><name>AI</name>
                <searchable>true</searchable>
                <userAttribute>true</userAttribute>
                <value>00</value>
            </Attribute>
        </rootItem>
    </StructureResponse>

In the Final Script I want to get an array string which contains every Attribute in it.

Thank you
Stefan

  • 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-12T17:40:27+00:00Added an answer on May 12, 2026 at 5:40 pm

    User marc_s’s answer is actually correct. You need to pay attention to the XML namespaces. His code sample, however, will not work directly for your example. Here is a full sample that works with the XML you gave (although I had to clean it up… it was missing a closing tag for attributes).

    string xmlData = 
    @"<?xml version='1.0' encoding='utf-8'?>
      <StructureResponse
         xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
         xmlns:xsd='http://www.w3.org/2001/XMLSchema'
         xmlns='http://nts-de-osm1-pxc/webservices/'>
        <consolidatedItems xsi:nil='true' xmlns='http://systinet.com/wsdl/com/osm/webservices/service/' />
        <rootItem xsi:type='Part' xmlns='http://systinet.com/wsdl/com/osm/webservices/service/'>
          <attributes>
            <Attribute>
              <dataDictionary xsi:nil='true' />
              <dataType>string</dataType>
              <displayName>IDENT_NR</displayName>
              <key>true</key>
              <name>IDENT_NR</name>
              <searchable>true</searchable>
              <userAttribute>true</userAttribute>
              <value>9662744</value>
            </Attribute>
            <Attribute>
              <dataDictionary xsi:nil='true' />
              <dataType>string</dataType>
              <displayName>AI</displayName>
              <key>true</key>
              <name>AI</name>
              <searchable>true</searchable>
              <userAttribute>true</userAttribute>
              <value>00</value>
            </Attribute>
          </attributes>
          </rootItem>
      </StructureResponse>";
    
    XmlDocument document = new XmlDocument();
    XmlNamespaceManager namespaceManager = new XmlNamespaceManager(document.NameTable);
    namespaceManager.AddNamespace("a", "http://nts-de-osm1-pxc/webservices/");
    namespaceManager.AddNamespace("b", "http://systinet.com/wsdl/com/osm/webservices/service/");
    document.LoadXml(xmlData);
    XmlNodeList nodes = document.SelectNodes("/a:StructureResponse/b:rootItem/b:attributes/b:Attribute", namespaceManager);
    // 'nodes' contains 2 items now, as expected
    

    I suggest doing a bit more studying of XML namespaces. Try skimming Ronald Bourret’s “XML Namespaces FAQ”.

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

Sidebar

Ask A Question

Stats

  • Questions 224k
  • Answers 224k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If the string inside the double quotes are guaranteed not… May 13, 2026 at 12:49 am
  • Editorial Team
    Editorial Team added an answer http://www.castleproject.org/subversion.html May 13, 2026 at 12:49 am
  • Editorial Team
    Editorial Team added an answer relation() only tells the mapper how are the two tables… May 13, 2026 at 12:49 am

Related Questions

I want use html5's new tag to play a wav file (currently only supported
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
In order to apply a triggered animation to all ToolTip s in my app,
I am currently running into a problem where an element is coming back from
I have a JSP page retrieving data and when single or double quotes are

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.