Sunday, January 19, 2020

XML Dot Net Interview Questions


              XML Dot Net Interview Questions it consists of set of interview questions which grabs the All levels from Intial Level to High Level definately it covers the potential stuff to all my viewers.

             XML Dot Net Interview Questions all provides the list of all entitled elements which provides an integrity solutions to the all my aspirants.
 "I Wish You All The Best...!To Crack Your Desired Position..."






1.What is XML?
A)Acronym for XML is Extensible Markup Language.It is an open standard format proposed by the w3 org.XML is used to structure the data or transporation of the data.It is not used for designing purpose.It is an simple and flexible markup language in the text formt.

2.How can we use XML in .Net?
A)We can use namespace using System.XML.It includes the entities belonging to xml inorder to work with xml.

3.What is the version of XML?
A)1.0 is the current verison of xml file.By using “version” tag we can know the version of XML.

4.How can we declare a tags in XML?
A)XML has a flexibility to declare a user defined tags but every opening of a tag requires a closing tag.

5.Is XML is case sensitive?
A)Yes.

6.What is the editor requires XML program?
A)It does not requires any editor.XML code can be written in any Text editor.

7.What is ROOT element in XML?
A) Root element is the top most elements for a XML.
E.G:
<student>
<rno1>
</rno1>
<rno2>
</rno2>
</student>
In our above example <student></student> is a root element.

8.If XML does not have closing tag will it work?
A)No, every tag in XML which is opened should have a closing tag.

9.List the classes in XML?
A)It contains two main classes.They are:
         Ø  XMLTextWriter
         Ø  XML TextReader

10.Define XMLTextWriter?
A)This class is used to write the data into an XML file.It can be incorporated from the namespace “Using System.Xml”.

11.Define XMLTextReader?
A)This class is used to read the data from an XML file.It can be incorporated from the namespace “Using System.Xml”.

12.Explore the difference between XML and HTML?
A)
SNO
XML
HTML
1
XML stands for Extensible Markup Language
HTML stands for Hyper Text Markup Language
2
It structures the data
It is used to design the data
3
Extension of XML File is .xml
Extension of HTML file is .html or .htm
4
It is a case sensitive language
It is not a case sensitive language
5
It supports user defined tags
It supports only predefined tags
6
All tags must be closed
No need to close all tags as per the tag syntactical structure.

13. Is XML meant to replace HTML?
A)No, they both go together one is for describing data while other is for displaying data.

14. Can you explain why your project needed XML?
A)Remember XML was meant to exchange data between two entities as you can define your
user friendly tags with ease. In real world scenarios XML is meant to exchange data. For
instance you have two applications who want to exchange information. But because they
work in two complete opposite technologies it’s difficult to do it technically. For instance
one application is made in JAVA and the other in .NET. But both languages understand
XML so one of the applications will spit XML file which will be consumed and parsed by
other applications.

15.What is an empty XML Element?
A)If there is no value in XML element then we can call it as empty XML Element.
E.g:<dotnet></dotnet>
Here there is no value in between XML element.So this can be termed as empty XML Element.

16.Define XML Document?
A) XmlDataDocument class extends XmlDocument and allows structured data to be stored, retrieved, and manipulated through a relational DataSet. This class allows components to mix XML and relational views of the underlying data.

17.What is XML Document Object Model (DOM)?
A) The XML Document Object Model (DOM) class is an in-memory representation of an XML document. The DOM allows you to programmatically read, manipulate, and modify an XML document. The XmlReader class also reads XML; however, it provides non-cached, forward-only, read-only access. This means that there are no capabilities to edit the values of an attribute or content of an element, or the ability to insert and remove nodes with the XmlReader. Editing is the primary function of the DOM. It is the common and structured way that XML data is represented in memory, although the actual XML data is stored in a linear fashion when in a file or coming in from another object.

18. How many parents can a child element in XML have?
A)A child element in XML can have exactly one parent. However, note that the root element can not have any parent element.
 For example:
<Books>
<CSE>Dot NET</CSE>
<ECE>Embedded Systems</ECE>
</Books>

19.List the namespaces in .NET are used for XML?
A) The System.xml.dll is the real physical file, which contains the XML implementation. Some of the other namespaces that allow .NET to use XML are as follows:
           Ø  System.Xml
           Ø  System.Xml.Schema
           Ø  System.Xml.XPath
           Ø  System.Xml.Xsl

20.Define XML attribute?
A)An XML attribute contains additional information relates to the xml element.Generally XML attribute use the name-value pair.
E.G:
<Staff SID=”PNV001”>
-------
</Staff>
Here sid is the attribute relates to the “Staff” XML element.

21.Define XPath?
A)Xpath is also termed as XML Path.It is a language used to access different parts of an XML document such as an elements and attributes.

22. What is DTD (Document Type definition)?
A)It defines how your XML should structure. So you can define the DTD document and use that DTD document with in that XML.

23.What is well formed XML?
If a XML document is confirming to XML rules (all tags started are closed, there is a rootelement etc) then it’s a well formed XML.

24.What is a valid XML?
A)If XML is confirming to DTD rules then it’s a valid XML.

25.What is CDATA section in XML?
A)All data is normally parsed in XML but if you want to exclude some elements you will need to put those elements in CDATA.

26.What is XSL?
A)XSL (the eXtensible Stylesheet Language) is used to transform XML document to some
other document. So its transformation document which can convert XML to some other
document. For instance you can apply XSL to XML and convert it to HTML document or
probably CSV files.

27. What are the standard ways of parsing XMLdocument?
A)There are two standard ways of parsing XML document.They are:
             Ø  DOM(Document Object Model)
             Ø  SAX(Simple API for XML)


28.Define SAX?
A)SAX: - Simple API for XML.
SAX is event driven way for processing XML documents. In DOM we load the whole
XML document in to memory and then application manipulates the XML document. But
this is not always the best way to process large XML documents which have huge data
elements. For instance you only want one element from the whole XML document or you
only want to see if the XML is proper which means loading the whole XML in memory
will be quiet resource intensive. SAX parsers parse the XML document sequentially and
emit events like start and end of the document, elements, text content etc. So applications
who are interested in processing these events can register implementations of callback
interfaces. SAX parser then only sends those event messages which the application has
demanded.

29)In What scenarios will you use a DOM parser and SAX parser?
A)Following are the scenarios.They are:
          Ø  If you do not need all the data from the XML file then SAX approach is much
preferred than DOM as DOM can quiet memory intensive. In short if you need
large portion of the XML document its better to have DOM.
         Ø  With SAX parser you have to write more code than DOM.
         Ø  If you want to write the XML in to a file DOM is the efficient way to do it.
         Ø  Some time you only need to validate the XML structure and do not want to retrieve any Data for those instances SAX is the right approach.

30.Is XML preserves white spaces?
A)Yes.XML preserves white spaces.

31.Which class is used to encode and decode XML names and contains different methods to convert between CLR types and XSD types?
A)The XmlConvert Class.

32.How to serialize XML documents?
A)Microsoft .Net  supports serialization of xml documents.By using the namespace of “Using System.Xml.Serialization”.It constitutes a class i.e is “XmlSerializer” by using this we can serialize xmldocuments.

33. What are the derived classes from xmlReader and xmlWriter?
A)Both XmlReader and XmlWriter are abstract base classes, which define the functionality that            all derived classes must support.
There are three concrete implementations of XmlReader:
1.XmlTextReader
2.XmlNodeReader
3.XmlValidatingReader
There are two concrete implementations of XmlWriter:
1.XmlTextWriter
2.XmlNodeWriter
XmlTextReader and XmlTextWriter support reading data to/from text-based stream, while XmlNodeReader and XmlNodeWriter are designed for working with in-memory DOM tree structure. The custom readers and writers can also be developed to extend the built-in functionality of XmlReader and XmlWriter.

0 comments:

Post a Comment