What is an XML file and how to open it?

The file with the .xml extension is the Extensible Markup Language file (XML). This is really just plain text files that use custom tags to describe the structure and other features of the document.

The file with the .xml extension is the Extensible Markup Language file (XML). This is really just plain text files that use custom tags to describe the structure and other features of the document.

What is XML?

XML is a markup language created by the World Wide Web Consortium (W3C) to define the syntax for encoding documents for human and machine readability. It does this through the use of tags that define the document structure as well as how documents are stored and shipped.

It can be easily compared to another markup language you may be familiar with - Hypertext Markup Language (HTML) is used to encrypt web pages. HTML uses a set of predefined markings (short codes) that describe the content format on a web page. For example, the following simple HTML code uses tags to make some words bold and some words in italics:

 Đây là cách bạn tạo văn bản Bold, này này làm thế nào bạn tạo bản văn 

What is an XML file and how to open it? Picture 1What is an XML file and how to open it? Picture 1

However, the difference is that XML is extensible, it does not have predefined markup languages ​​such as HTML. Instead, XML allows users to create their own markup icon to describe content, create an unlimited icon and define themselves. In particular, HTML is a language that focuses on presenting content, while XML is a language that describes the data used to store data.

XML is often used as a basis for other document formats. Here are some formats you may know

  1. RSS and ATOM both describe how the application reads the web feed processing.
  2. Microsoft .NET uses XML for its configuration files.

  3. Microsoft Office 2007 and later versions use XML as the basis for document structure. "X" in Word document format .DOCX comes from here. In addition, it is also used in Excel (XLSX file) and PowerPoint (PPTX file).

How to open the XML file

There are several ways you can open XML files directly like opening and editing them with a text editor, viewing files with any web browser or using a web page that lets you view, edit and even convert they are in other formats.

Use a text editor if you work regularly with XML files

Because XML files are really just text files, you can open them in any text editor. The problem is, many text editors - like Notepad - are not designed to display XML files with its proper structure. You can use Notepad to open XML files and see them quickly, but there are better tools to work with these files. To open the XML file in Notepad, right-click the XML file you want to open, point to ' Open with ' on the context menu, and click the ' Notepad ' option.

What is an XML file and how to open it? Picture 2What is an XML file and how to open it? Picture 2

Note : The example here we use on Windows but on other operating systems is still possible. Look for a third-party text editor designed to support XML files on other operating systems.

The XML file has been opened but you can see, it takes most of the original format and leaves the entire content in two rows of documents.

What is an XML file and how to open it? Picture 3What is an XML file and how to open it? Picture 3

Although, Notepad is useful for quickly checking XML files, it breaks the original file format. Use a more advanced tool like Notepad ++, which will highlight the syntax and format the file the way it was formatted.

Below is the same XML file opened in Notepad ++:

What is an XML file and how to open it? Picture 4What is an XML file and how to open it? Picture 4

See also: How to read XML files with iTaxViewer software

Use the web browser to view structured data

If you don't edit the XML file, just view it, then the browser you're using is very suitable for this job. And in fact, your default browser can be set as the default XML file viewer. Therefore, double click on the XML file to open it in the browser.

If not, you can right-click the file to find the option to open the file with any application you want. Just select your web browser from the list of programs. The example here select Chrome.

What is an XML file and how to open it? Picture 5What is an XML file and how to open it? Picture 5

When the file opens, you will see the data is neatly structured. It doesn't look as good as it looks in the code that is color coded when opened with Notepad ++ but better when opened with Notepad.

What is an XML file and how to open it? Picture 6What is an XML file and how to open it? Picture 6

Use the online editor to view, edit or convert XML files

If you occasionally want to edit an XML file and don't want to download a new text editor or if you need to convert an XML file to another format, there are a number of rich online XML editors available for free. Websites like TutorialsPoint.com, XMLGrid.net and CodeBeautify.org allow you to view and edit XML files. After you have made the edit, you can download the modified XML file or even convert the file to another format.

For example, here we will use CodeBeautify.org. The page is divided into three parts. On the left is the XML file you are working on; In the middle, you will find some options; on the right is the result when making changes. For example, in the picture below, the full XML file is on the left and the tree view is displayed in the results table after selecting the " Tree View " button.

What is an XML file and how to open it? Picture 7What is an XML file and how to open it? Picture 7

The image below is the options in the middle, to help you see better. Use the " Browse " button to upload XML files from your computer or " Load URL " button to pull XML from online sources.

What is an XML file and how to open it? Picture 8What is an XML file and how to open it? Picture 8

The ' Tree View ' button displays your data in a nicely formatted tree structure in the results pane, with all your tags on the left orange and attributes on the right of the tags.

What is an XML file and how to open it? Picture 9What is an XML file and how to open it? Picture 9

" Beautify " displays your data with neat, easy-to-read lines in the results pane.

What is an XML file and how to open it? Picture 10What is an XML file and how to open it? Picture 10

The ' Minify ' button displays your data using as little white space as possible. It tries to put all pieces of data on one line. This type of display is very handy when making smaller files. It will save some space but still read efficiently.

What is an XML file and how to open it? Picture 11What is an XML file and how to open it? Picture 11

And finally, you can use the ' XML to JSON ' button to convert the XML format to JSON, the ' Export to CSV ' button to save the data as a comma-separated value file or the ' Download ' button. to download any changes you make in the new XML file.

See more:

  1. Trick to create XML files in Word 2003
  2. Query XML data from a table with XML data type
  3. Upload multiple XML files into XML data type columns
4.8 ★ | 4 Vote