Latest XML Interview Questions and Answers

Read Top XML Interview Questions and Answers Experienced, Freshers for Job Interview Quiz with Solutions.

Can I replace HTML with XML?

No, XML is not a replacement of HTML. XML provides an alternative approach to define own set of markup elements, and it is used for processing and storing data.

What is Complex Element?

A complex element contain other elements or attributes and following are kinds of Complex Elements:

  • It has empty elements

  • It contain other elements

  • It contain only text

  • It contain both other elements and text

What is XML?

XML is called Extensible Markup Language which is designed to carry or transport and store data. XML tags are not as predefined as HTML, but we can define our own user tags for simplicity. It mainly concentrates on storing of data, not on displaying of data.

What are XML Namespaces?

XML namespaces are used to avoid element name conflicts, and it can be avoided by using prefix before the name.

How can I include conditional statements in XML?

We cannot include conditional statement as like programming language.

<foo if{DB}=”A”>bar</foo>

This can be done by using Document Type Definition(DTD).

<xsl:if test=”@foo=’bar’”>

<xsl:text>Hello, world!</xsl:text>


Is there a way to describe XML data?

Yes, XML uses Document Type Definition (DTD) to describe the data.

What are the features of XML?

Main features of XML are:

• Very easy to learn and implement

• XML files are text files, and no editor is required

• Minimal and a limited number of syntax rules in XML

• It is extensible, and it specifies that structural rules of tags

What is XML Parser?

XML Parser is used to convert from XML document into an XML DOM object which can be written in Javascript.

What are the benefits of XML?

Benefits of XML are

• Simple to read and understand

• XML can be done with a text editor

• Extensibility – No fixed tags

• Self – descriptive

• Can embed multiple data types

What are the three parts of XSL?

XSL consists of three parts:

  • XSLT – Used to transform XML documents

  • XPath – Used for navigating in XML documents

  • XSL-FO – Used for formatting XML documents

What are the differences between HTML and XML?

Following are the differences between HTML and XML:



Markup language used to display data Markup language used to store data
Case Insensitive Case sensitive
Designing web pages Used to transport and store data
Predefined Tags Custom Tags
Does not Preserve white spaces Preserve white spaces
Static Dynamic

What is XSL?

XSL is a language used with XML for expressing style sheets as like CSS. It describes how to display an XML document for a given type.

What are the disadvantages of XML?

Following are the disadvantages of XML:

• XML will be just a text file if elements and attributes are not defined properly.

• Overlapping markup is not permitted

What is the correct syntax when we define XML version?

<?xml version=”1.0”/>

is the correct declarative syntax used to define XML version.

Which tag is used to find the version of XML and the syntax?

Declaring the XML version is very important for each XML document and platform needs to be specified in which it is running.

<?xml version=”1.1” encoding=”|ISO-8859-1|”?>

Who is responsible for XML?

XML is a recommendation of the W3C – World Wide Web Consortium and the development are supervised by XML working group.

What is DTD?

DTD is abbreviated as Document Type Definition and it is defined to build legal building blocks of an XML document. It defines the XML document structure with elements and attributes.

If XML attribute name itself has double quotes, then how it can be represented?

Attribute name can be represented within single quotes if double quotes are present in the attribute name.

Example –

<country city=’Texas “US”’></country>

What is XML DOM Document?

XML Document object represents the whole XML document, and it is the root of a document tree. It gives access to entire XML document – Nodes and Elements, and it has its own properties.


Popular posts from this blog

TOP Agile Testing Interview Questions and Answers

Latest Agile Testing Interview Questions and Answers

Most Asked ADO.NET Interview Questions and Answers