filmov
tv
Part 1 LINQ to XML

Показать описание
If you are a foodie like me, I am sure you will enjoy the recipes on my friend's YouTube channel. If you find them useful, please subscribe and share to support her. She's really good at what she does.
Creating an XML document using LINQ to XML.
Text version of the video
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
Slides
LINQ to SQL Tutorial - All Text Articles & Slides
LINQ to XML Tutorial Playlist
Dot Net, SQL, Angular, JavaScript, jQuery and Bootstrap complete courses
What is Functional Construction?
As far as LINQ to XML is concerned there is a technical term called Functional Construction. First let us understand what this term means with an example. Functional construction is the ability to create an XML tree in a single statement.
Let us now discuss, creating an an XML tree in a single statement.
All the classes to create an XML document are present in System.Xml.Linq namespace. To create
XML Document use XDocument class
XML Declaration use XDeclaration class
XML Comment use XComment class
XML Element use XElement class
XML Attribute use XAttribute class
Code to create the XML Document
using System.Xml.Linq;
namespace Demo
{
class Program
{
public static void Main()
{
XDocument xmlDocument = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XComment("Creating an XML Tree using LINQ to XML"),
new XElement("Students",
new XElement("Student", new XAttribute("Id", 101),
new XElement("Name", "Mark"),
new XElement("Gender", "Male"),
new XElement("TotalMarks", 800)),
new XElement("Student", new XAttribute("Id", 102),
new XElement("Name", "Rosy"),
new XElement("Gender", "Female"),
new XElement("TotalMarks", 900)),
new XElement("Student", new XAttribute("Id", 103),
new XElement("Name", "Pam"),
new XElement("Gender", "Female"),
new XElement("TotalMarks", 850)),
new XElement("Student", new XAttribute("Id", 104),
new XElement("Name", "John"),
new XElement("Gender", "Male"),
new XElement("TotalMarks", 950))));
}
}
}
Creating an XML document using LINQ to XML.
Text version of the video
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
Slides
LINQ to SQL Tutorial - All Text Articles & Slides
LINQ to XML Tutorial Playlist
Dot Net, SQL, Angular, JavaScript, jQuery and Bootstrap complete courses
What is Functional Construction?
As far as LINQ to XML is concerned there is a technical term called Functional Construction. First let us understand what this term means with an example. Functional construction is the ability to create an XML tree in a single statement.
Let us now discuss, creating an an XML tree in a single statement.
All the classes to create an XML document are present in System.Xml.Linq namespace. To create
XML Document use XDocument class
XML Declaration use XDeclaration class
XML Comment use XComment class
XML Element use XElement class
XML Attribute use XAttribute class
Code to create the XML Document
using System.Xml.Linq;
namespace Demo
{
class Program
{
public static void Main()
{
XDocument xmlDocument = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XComment("Creating an XML Tree using LINQ to XML"),
new XElement("Students",
new XElement("Student", new XAttribute("Id", 101),
new XElement("Name", "Mark"),
new XElement("Gender", "Male"),
new XElement("TotalMarks", 800)),
new XElement("Student", new XAttribute("Id", 102),
new XElement("Name", "Rosy"),
new XElement("Gender", "Female"),
new XElement("TotalMarks", 900)),
new XElement("Student", new XAttribute("Id", 103),
new XElement("Name", "Pam"),
new XElement("Gender", "Female"),
new XElement("TotalMarks", 850)),
new XElement("Student", new XAttribute("Id", 104),
new XElement("Name", "John"),
new XElement("Gender", "Male"),
new XElement("TotalMarks", 950))));
}
}
}
Комментарии