Google News
logo
XML Interview Questions
XML stands for eXtensible Markup Language. It is a simple and flexible 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.  It was evolved from an older standard format known as SGML in order to make it more Web-friendly.
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
HTML stands for Hyper Text Markup Language while XML stands for eXtensible Markup Language. The differences between HTML and XML are given below :

S No. HTML XML
1 HTML is used to display data and focuses on how data looks. XML is a software and hardware independent tool used to transport and store data. It focuses on what data is.
2 HTML is a markup language itself. XML provides a framework to define markup languages.
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.
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.
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.
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|”?>

 

These are the main benefits of using XML.
 
Simplicity : Very easy to read and understand the information coded in XML.
 
Openness : It is a W3C standard, endorsed by software industry market leaders.
 
Extensibility : It is extensible because it has no fixed set of tags. You can define them as you need.
 
Self-descriptive : XML documents do not need special schema set-up like traditional databases to store data. XML documents can be stored without such definitions, because they contain metadata in the form of tags and attributes.
 
Scalable : XML is not in binary format so you can create and edit files with anything and it is also easy to debug.
 
Fast access : XML documents are arranged in hierarchical form so it is comparatively faster.
Step 1 : Open Microsoft Excel
Step 2 : Click on ‘file’ on the top left corner of MS Excel. If you are using MS Excel version 2007, click on the MS Office logo.
Step 3 : You will land on the ‘open’ tab; if not, select the ‘open’ tab. Click ‘browse’ for the MS Excel version of 2010 and above.
Step 4 : Double click on the XML file you want to export into MS Excel.
Step 5 : Select ‘Open the file without applying a style sheet’ to select the standard format, or ‘Open the file with the stylesheet applied’ to format the data in accordance with the style sheet.
Step 6 : Click on ‘save as’ and select ‘Excel Workbook’ from the drop-down menu.
Step 7 : Save the file!
DTD stands for Document Type Definition. DTD defines the structure, elements and attributes of an XML document. Document Type Definition forms like the structure of the tree and describes something about its data. Document Type Definition (DTD) consists of SGML family structure, like GML, SGML, HTML, XML. In this case, it’s XML.
 
A DTD can be declared inline or as an external recommendation within an XML document. The DTD specifies how many times a node should appear and how their child nodes should be ordered.
 
PCDATA and CDATA are the two data types.
 
* PCDATA is character data that has been parsed.
* CDATA is character data that is not typically parsed.
SQL is good for tabular data, or information that fits neatly into rows and columns. XML is ideal for hierarchical data or data that has multiple levels of varying sizes. SQL is useful for storing and searching data. XML is useful for both conveying and formatting data.
 
Instead of developing a whole database, you might utilise XML. However, I would recommend that you consider the type and amount of data you want to keep, as well as your justifications for not using a database. The relational elements of a database, such as MySql or SQL, are one of the benefits of using one. The database server's ability to execute a reasonable amount of work, as well as the fact that this is a typical method of storing data in the tech world.
 
Nowadays, there are several alternatives to using a full-scale database, one of which is XML.
You can also store data as a JSON object if you're using Javascript, or as an array in whatever programming language, you're using. There are NoSql databases that use JSON to store data as a single large array of key => value pairs that can be nested for quite complex data structures. If you're using a framework like React, you can also use Flux or Redux to store data in a Javascript structure known as a Store.