-
Notifications
You must be signed in to change notification settings - Fork 0
C# Linq XML
sitapriyanka edited this page Jun 25, 2020
·
2 revisions
For Pragim xml slidesUsing XDocument We can create to a file and Load the documents from a file. 1. * XDocument, 1. * XDeclaration 1. * XComment 1. * XElement 1. * XAttribute are some classes that are required to create xml class.
We can use linq to get and update xelements.
To get the second student name return XDocument.Load(@"D:\c#\LinqXml\Students.xml").Descendants("Student").ElementAt(2) .Element("Name").Value;
XDocument.Load("FilePath") to load XML file into system. XSchema To get schema from XSD and use XDocument.Validate(Schema, Xdocument) to validate document against schema.