Select nodes from XmlDocument : Xml Node « XML « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.2D
26.Design Patterns
27.Windows
28.XML
29.XML LINQ
30.ADO.Net
31.Network
32.Directory Services
33.Security
34.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » XML » Xml Node 
28.11.5.Select nodes from XmlDocument
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Net;

class MainClass
{
    static void Main(string[] args)
    {
        WebClient client = new WebClient();
        string rssFeed = client.DownloadString("http://blogs.apress.com/wp-rss2.php");

        XmlDocument doc = new XmlDocument();
        doc.LoadXml(rssFeed);

        XmlNodeList nodes = doc.SelectNodes("rss/channel/item/title");
        foreach (XmlNode node in nodes)
        {
            Console.WriteLine(node.InnerText);
        }
    }
}
28.11.Xml Node
28.11.1.Find nodes by name
28.11.2.Select Nodes By Namespace from XmlDocument
28.11.3.XmlNode: InsertAfter FirstChild
28.11.4.Xml Node List
28.11.5.Select nodes from XmlDocument
28.11.6.Recursively display XmlNode
28.11.7.Replace Children
28.11.8.Root Node
28.11.9.Insert after
28.11.10.Append element
28.11.11.Get current value and depth during the XML document reading process
28.11.12.Read XML document by node type
28.11.13.Check for Xml node name
28.11.14.Extract elements for types
28.11.15.Get elements
28.11.16.Select By Specific Author Node
28.11.17.Write types to the console
28.11.18.Select node by node text
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.