Get the local name of element in CSharp

Description

The following code shows how to get the local name of element.

Example


    /*from   w w  w  .j  ava  2 s. c  o  m*/
using System;
using System.Linq;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;


public class MainClass{
   public static void Main(){
        XNamespace ns = "http://www.domain.com";
        XElement el2 = new XElement(ns + "Root", "content");
        Console.WriteLine(el2.Name.LocalName);
   }
}




















Home »
  C# Tutorial »
    XML »




Load Parse
Document
Element
Attribute
Namespace
Query
Save
Schema
Style