Home >>Interview Questions >XML Interview Questions
Questions and answers from XML interviews are given which have been asked in other companies. Let's see the compilation of top 25 XML queries from the interview.
XML stands for the language of the eXtensible Markup. It is a simple, flexible language for markups. It is recognized for data on the web as a common language, since XML documents can be generated and used in any language. It is universal standard for the sharing of information.
XML technology helps you to build your own language for markups.
DOM stands for Document Object Model which is used to describe XML document's logical structure. It's a hierarchical model that provides a way to manage and navigate an XML document.
Any language such as C #, VB, JavaScript and VB Script can use DOM methods and objects.
DTD stands for description of type of document. A leading building block of an XML document is specified. This does define:
XSLT is a common XML technology that converts one XML file into another document, such as HTML etc. XSLT is like a language for the transformation of XML documents that has its own syntax, functions and operator. XSLT is often known as the HTML pages for viewing data present in XML files.
HTML stands for the Hyper Text Markup Language, while XML stands for the markup language eXtensible. Here are the main distinctions between HTML and XML:
Sr No | HTML | XML |
---|---|---|
1. | HTML is used to display data and to focus on the look of the data. | XML is an independent software and hardware tool used for the data transmission and storage. It focuses on what defines data. |
2. | HTML itself is a markup language. | XML offers a basis for specifying languages for the markup. |
3. | HTML is not case sensitive. | XML is case sensitive. |
4. | HTML is a presentation language. | XML is neither a presentation language nor a programming language. |
Version is a tag that shows which version of XML is being used.
No, the two languages have their own specifications and are used for various purposes. XML is used to describe data but while HTML focuses on displaying data.
The key benefits of using XML are those.
Simplicity:The knowledge stored in XML is really simple to read and understand.
Openness:It is a W3C standard which is endorsed by market leaders in the software industry.
Extensibility: Extensible because it doesn't have a fixed set of tags. You can describe them however you like.
Self-descriptive: XML documents do not require unique schema configurations to store data like traditional databases. Without these concepts XML documents may be processed as they include metadata in the form of tags and attributes.
Scalable: XML is not in binary format so that you can create and edit files with anything, and debugger is easy too.
Fast access: XML documents are hierarchically arranged and it's comparatively easier.
SAX stands for Simple XML API. It is a parser with sequential access. It is a simple XML API which provides a data reading mechanism from an XML document. This is a DOM replacement. DOM works on the documents as a whole, SAX parsers work sequentially on each component of the XML document.
SAX does not have any formal specification like DOM and consumes fewer memory. But this can be used to only not compose the XML document.
XSNL is a language neutral to XML search. It language works as guided system and meta search interface.
XPath is an XML-type technology. Used for removing items from XML documents. Since XML documents are structured, XPath expressions may be used to find and extract objects, attributes and values from XML data. It's similar to SQL.
Since SQL is used to get data from the database, XPath is used to get data from XML.
A syntactically formed XML document is considered a syntactically correct document. Does the XML need to follow a well defined XML document? Simple syntax rules:
A valid XML document is termed a structurally correct element. It should follow certain predefined rules for a particular type of document. These rules determine the type of data which can comprise each part of the document. The author of an XML document or someone else can write those rules.
There are two types of errors about XML encoding:
It is because XML document can include non-ASCII characters such as Norwegian and French. You can avoid such errors by specifying the Unicode XML encoding.
You can: To add a DTD to an XML document.
You should consider writing an XML document with the following rules.
XSL stands for the language of Extensible Stylesheets. It is a language used to express stylesheets. Such stylesheets are identical to CSS, which specifies how to view a given type of XML document.
XSL stands for the language of Extensible Stylesheets. It is a language used to express stylesheets. Such stylesheets are identical to CSS, which specifies how to view a given type of XML document.
All you see in an XML document is XML element, from the start tag to the end tag. This may be comprised of other elements, attributes and texts.
An Attribute is a definition used to define additional element detail.
Let's take an example to understand it well:
<librarymembers>
<student id="1">
<name>suresh</name>
<age>45</age>
</student>
</librarymembers>
In the above example, <student> is an element and id is an attribute of the <student> element.
Simple elements in XML are items based on a text. It has less attributes, less child elements and can not be left empty.
Complex elements can therefore hold multiple attributes and elements. It can also include additional sub-elements and empty-element.
XPOINTER is used for pointing data to XML document. The actual part of the XML document is located with it. It is approved by the W3C.
See this example:
address.xml#pointer(/ descendant ::streetnumber[@id =9])
In this example, XPOINTER points "streetnumber = 9" in "address.xml".
XML data binding is the process through which the information in the XML document is interpreted as an object in computer memory.
Binding XML data is used to reduce the development effort, simplify maintenance, increase reliability. It's saving time and money on your growth. It makes the XML data very intuitive to work with.
A document may contain duplicate elements and attributes. Therefore, namespace specifies a means of comparing similar items and names of the attributes.
Tree-based API: It compiles and loads an XML document into the memory in a tree-like structure. You may traverse the tree structure, and alter it. Tree-based API's are useful for a wide range of uses. DOM parser is an example of a Tree-based API.
Event-based API: An event-based API delivers the information surrounding the parsing case to an application. This requires an integrated collection of callback features. SAX parser is an example of event-based API.
The XmlrReader class is a reader which provides fast, non-cached, forward-only access to XML data. To function with XmlReader class in.NET you will import the following namespaces.
In VB:
Imports System.Xml
In C#:
using System.Xml;
SGML is a detailed and efficient generalized markup language used to describe definitions for structuring several electronic documents.
CDATA means data of unparsed characters whereas PCDATA is data of parsed characters.
XQuery is a query language used for recovering data from XML document.
Yes, XML is a case sensitive language.