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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:57:57+00:00 2026-05-25T15:57:57+00:00

i am trying to parse an xml element using XMLDocument ( DItem >> Title

  • 0

i am trying to parse an xml element using XMLDocument (DItem >> Title)
below is my code but somehow i am not getting hold of it…. any help?

XmlDocument xmldoc = new XmlDocument();
            XmlNamespaceManager xmlns = new XmlNamespaceManager(xdoc.NameTable);
            xmlns.AddNamespace("DItems", "http://namespace.xsd");
            xmldoc.Load(url); 

        var title = xmldoc.SelectNodes("content", xmlns);
        foreach (XmlNode node in title)
        {
            string title = node.Attributes["Title"].Value;
            //this.ddlTitle.Items.Add(new ListItem(title));
        }

here is my XML:

    <?xml version='1.0'?>
<root xmlns="http://www.w3.org/2005/Atom">
  <title type="text">title</title>
  <entry>
    <content type="application/xml">
      <Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.namespace.xsd">
        <CatalogSource Acronym="ABC" OrganizationName="organization name" />
        <Item Id="28466" CatalogUrl="url">
          <DItem xmlns:content="http://namespace.xsd" TargetUrl="http://index.html" Title="my title1">
            <content:Source Acronym="ABC" OrganizationName="ABC" />
          </DItem>
        </Item>
      </Items>
    </content>
  </entry>
  <entry>
    <content type="application/xml">
      <Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.namespace.xsd">
        <CatalogSource Acronym="ABC" OrganizationName="organization name" />
        <Item Id="28466" CatalogUrl="url">
          <DItem xmlns:content="http://namespace.xsd" TargetUrl="http://index.html" Title="my title2">
            <content:Source Acronym="ABC" OrganizationName="ABC" />
          </DItem>
        </Item>
      </Items>
    </content>
  </entry>
  <entry>
    <content type="application/xml">
      <Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.namespace.xsd">
        <CatalogSource Acronym="ABC" OrganizationName="organization name" />
        <Item Id="28466" CatalogUrl="url">
          <DItem xmlns:content="http://namespace.xsd" TargetUrl="http://index.html" Title="my title3">
            <content:Source Acronym="ABC" OrganizationName="ABC" />
          </DItem>
        </Item>
      </Items>
    </content>
  </entry> 
</root>
  • 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-25T15:57:57+00:00Added an answer on May 25, 2026 at 3:57 pm
    var xmldoc = new XmlDocument();
    var xmlns = new XmlNamespaceManager(xmldoc.NameTable);
    xmlns.AddNamespace("DItems", "http://www.namespace.xsd");
    xmldoc.Load(url);
    
    var titleNodes = xmldoc.SelectNodes("//DItems:DItem/@Title", xmlns);
    
    var result = titleNodes.Cast<XmlAttribute>().Select(a => a.Value).ToList();
    

    Output (list of objects):

    my title1
    my title2
    my title3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to parse XML with Python but not getting very far. I
I am trying to pass the XML code below, in the first instance using
I am trying to parse an XML file using NSXMLParser, but the method [parser
Trying to parse some XML but apparently this is too much for a lazy
So I'm trying to parse some XML, the creation of which is not under
So I'm trying to parse the following XML document with C#, using System.XML: <root
I am trying to parse an XML file using the SAX interface of libxml2
Hi Im trying to parse an xml feed using simplexml in php. The xml
I'm trying to parse an mrss feed using jquery but am having some difficulty
I am trying to parse XML in Perl using XML::SAX parser . My query

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.