Create an XElement from tag name and double value in CSharp

Description

The following code shows how to create an XElement from tag name and double value.

Example


    //from  w  w  w  . java  2s .  co m
using System;
using System.Linq;
using System.Xml.Linq;


public class MainClass{
   public static void Main(){
        XElement root;
        
        double dbl = 12.1;
        root = new XElement("Root", dbl);
        Console.WriteLine(root);
        
    }
}




















Home »
  C# Tutorial »
    XML »




Load Parse
Document
Element
Attribute
Namespace
Query
Save
Schema
Style