Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




XML(.NET) interview questions: - What is XML?

XML stands for extensible markup language and purpose of it is describing data.  

One of the biggest problems when two applications want to talk to each other is their development environment. One may be built using .net whereas one using Java. Both cannot understand each other’s objects. In simple words the way in which data is represented will not be familiar to each other.
They have to use some standard format for representing and exchanging data. XML is all about that.
It describes data.
 
For instance we will represent Students using XML as follows

<Students>

<Studentid="1"Name="Raghu Menon">

<MarksInEnglish>56</MarksInEnglish>

<MarksInMaths>66</MarksInMaths>

<MarksInScience>76</MarksInScience>

</Student>

 

<Studentid="2"Name="Ramesh Pujary">

<MarksInEnglish>56</MarksInEnglish>

<MarksInMaths>95</MarksInMaths>

<MarksInScience>95</MarksInScience>

</Student>

 

<Studentid="3"Name="Kamlesh Mehta">

<MarksInEnglish>62</MarksInEnglish>

<MarksInMaths>52</MarksInMaths>

<MarksInScience>63</MarksInScience>

</Student>

 

<Studentid="4"Name="Sukesh Marla">

<MarksInEnglish>85</MarksInEnglish>

<MarksInMaths>35</MarksInMaths>

<MarksInScience>65</MarksInScience>

</Student>

 

<Studentid="5"Name="Dinesh Bhoje">

<MarksInEnglish>75</MarksInEnglish>

<MarksInMaths>76</MarksInMaths>

<MarksInScience>73</MarksInScience>

</Student>

</Students>

What is XPath?

XPath is again a standard language for querying over our xml data. We can simply query over our xml data using Xpathsynatxes.

Example – 

  • /Students/Student/@Namewill be used to get list of names
  • Students/Student[MarksInEnglish>60] will be used get all students who have obtained more than 60 marks in English subject.

.NET support for XPATH?

There are various classes provided by Microsoft in System.Xml.Xpath namespace such as XPathDocument, XPathNavigator,XPathNodeIteratoretc using which we can filter elements of xml documents.


















  

Helpful Website Url
http://www.questpond.com/
Share this article   |    Print    |    Article read by 4680 times
Author:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles:
Related Interview Questions: