Top 50 XML Interview Questions & Answers: 1. What Is A Markup Language?
Top 50 XML Interview Questions & Answers: 1. What Is A Markup Language?
com/
Markup languages are designed for presentation of text in different formats, and it can also be
used for transporting and storing data. This markup language specifies the code for formatting,
layout and style of data .This markup code is called Tag.
2. 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.
1/9
https://career.guru99.com/
HTML 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
5. 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.
[crayon-5f2e95f82a20a854445174/]
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.
7. What is XPath?
XPath is used to find information in an XML document and contains standard functions. XPath
is the major element in XSLT, and it is w3c recommendation.
8. What is an attribute?
Example -
2/9
https://career.guru99.com/
[crayon-5f2e95f82a20e916216926/]
Yes, we can have empty tags in XML. Empty tags are used to indicate elements that have no
textual content. Empty tags can be represented as
[crayon-5f2e95f82a210936316023/]
• XML structure is traversable, and it can be randomly accessed by traversing the tree.
• XML structure is modifiable, and values can be added, changed and removed
An XML document contains XML Elements, and it starts from an element’s start tag to end tag.
It can contain:
• An Attribute
3/9
https://career.guru99.com/
• text
CDATA is unparsed character data that cannot be parsed by the XML parser. Character are
illegal in XML elements. CDATA section starts with ”.
Comment can be represented as as like HTML. This comment symbol is applicable for single or
multiple lines.
XML namespaces are used to avoid element name conflicts, and it can be avoided by using
prefix before the name.
XML Parser is used to convert from XML document into an XML DOM object which can be
written in Javascript.
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.
XML is a recommendation of the W3C – World Wide Web Consortium and the development are
supervised by XML working group.
An XML schema gives the definition of an XML document, and it has following:
4/9
https://career.guru99.com/
SGML is large and powerful Standard Generalized markup Language which is used to define
descriptions of the structure of different types of electronic document.
No, we cannot execute XML, and it is not a programming language to execute. It is just a
markup language to represent the data.
and & are the special characters used in XML. Because these characters are used for making
tags.
There are thousands of programs available for XML and updated list will be present in
http://xml.coverpages.org.
5/9
https://career.guru99.com/
Yes, Graphics can be included in XML by using XLink and XPointer specifications. It supports
graphic file formats like GIF, JPG, TIFF, PNG, CGM, EPS and SVG.
XLink:
[crayon-5f2e95f82a213659303227/]
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.
• Self – descriptive
• XML will be just a text file if elements and attributes are not defined properly.
6/9
https://career.guru99.com/
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 one or more elements are nested inside the root element is called nested element. Nesting
can be easy to understand and also keeps order in an XML document.
XQuery was designed to query XML data which is nothing but SQL for database tables. XQuery
is used to fetch the data from the XML file.
XLink is the standard way of creating hyperlinks in the XML files. Xpointer which allows those
hyperlinks to point to more specific parts of the XML file or document.
XML editors are required to write error free XML documents, and it is used to validate against
DTD or schema. Editors are able to check:
XML documents may contain Non-ASCII characters like French and Norwegian characters.
XML Encoding is used to avoid errors and XML files have to be saved as Unicode.
When the XML file is validated against the Document Type Definition(DTD), then it is called
valid XML. DTD is nothing but it defines the structure of an XML file.
7/9
https://career.guru99.com/
A simple element contain only text and following are the kinds of Simple Element:
No attributes
Doesn't contain other elements
It cannot be empty
A complex element contain other elements or attributes and following are kinds of Complex
Elements:
Yes, XML uses Document Type Definition (DTD) to describe the data.
44. 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 -
[crayon-5f2e95f82a219598586803/]
8/9
https://career.guru99.com/
There are two types of parsers – Non-Validating and Validating Parsers. Name itself implies
Non-Validating will not validate the XML and Validating parser will validate the XML with DTD.
46. Whether root element is required for XML? If so, how many root elements are
required?
Yes, root element is required, and it can have only one root element in each XML.
XML Signature is recommended by W3C, and it acts as a digital signature for XML documents.
If the signature is contained outside the document, it is called detached signature. If it contains
inside the XML document, then it is called Enveloping signature.
An XML Data island is XML data embedded into a HTML page. This works only with the
Internet.
A DiffGram is an XML format which is used to find current and original versions of XML
document.
9/9
Powered by TCPDF (www.tcpdf.org)