{"id":21881,"date":"2026-05-18T10:14:49","date_gmt":"2026-05-18T07:14:49","guid":{"rendered":"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/"},"modified":"2026-11-15T22:52:20","modified_gmt":"2026-11-15T19:52:20","slug":"what-is-xml","status":"publish","type":"post","link":"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/","title":{"rendered":"What Is XML? Meaning, Format Rules, Example XML File and Uses"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Example_XML_File\" >Example XML File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Basic_Rules_of_the_XML_Format\" >Basic Rules of the XML Format<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#The_Difference_Between_XML_HTML_and_JSON\" >The Difference Between XML, HTML and JSON<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Where_Is_XML_Used\" >Where Is XML Used?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#How_to_Open_an_XML_File\" >How to Open an XML File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Is_XML_a_programming_language\" >Is XML a programming language?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#What_is_the_biggest_difference_between_XML_and_HTML\" >What is the biggest difference between XML and HTML?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/sunucun.com.tr\/blog\/what-is-xml\/#Why_does_my_XML_file_give_an_error\" >Why does my XML file give an error?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p class=\"wp-block-paragraph\"><strong>XML<\/strong>, short for <strong>Extensible Markup Language<\/strong>, is a markup language used to <strong>store and transport data by structuring it with tags<\/strong> in a way that both people and programs can read. It was standardised by the W3C (World Wide Web Consortium); its first version, XML 1.0, was published in 1998. Unlike HTML, it has no predefined tags: you choose the tag names to fit the data (for example <code>&lt;book&gt;<\/code>, <code>&lt;price&gt;<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_XML_File\"><\/span>Example XML File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;library&gt;\n  &lt;book id=\"1\" lang=\"en\"&gt;\n    &lt;title&gt;Les Mis\u00e9rables&lt;\/title&gt;\n    &lt;author&gt;Victor Hugo&lt;\/author&gt;\n    &lt;price currency=\"TRY\"&gt;250&lt;\/price&gt;\n  &lt;\/book&gt;\n  &lt;book id=\"2\" lang=\"en\"&gt;\n    &lt;title&gt;Pride and Prejudice&lt;\/title&gt;\n    &lt;author&gt;Jane Austen&lt;\/author&gt;\n    &lt;price currency=\"TRY\"&gt;180&lt;\/price&gt;\n  &lt;\/book&gt;\n&lt;\/library&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first line is the <strong>XML declaration<\/strong> (version and character encoding). <code>&lt;library&gt;<\/code> is the <strong>root element<\/strong>; all the data is inside it. The <code>&lt;book&gt;<\/code> elements are children of the root. Expressions such as <code>id=\"1\"<\/code> are <strong>attributes<\/strong>, and the text between the tags is the element&#8217;s value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Basic_Rules_of_the_XML_Format\"><\/span>Basic Rules of the XML Format<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A document that follows these rules is called <strong>well-formed XML<\/strong>; a document that does not will cause an error in XML parsers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The document must have <strong>a single root element<\/strong>.<\/li>\n<li>Every opened tag must be closed: <code>&lt;name&gt;...&lt;\/name&gt;<\/code>, or <code>&lt;name\/&gt;<\/code> for an empty element.<\/li>\n<li>Tags must be nested in the right order: <code>&lt;a&gt;&lt;b&gt;&lt;\/b&gt;&lt;\/a&gt;<\/code> is correct, <code>&lt;a&gt;&lt;b&gt;&lt;\/a&gt;&lt;\/b&gt;<\/code> is wrong.<\/li>\n<li>Tag names are <strong>case-sensitive<\/strong>: <code>&lt;Book&gt;<\/code> and <code>&lt;book&gt;<\/code> are different.<\/li>\n<li>Attribute values are written in quotes.<\/li>\n<li>In text, the characters <code>&amp;<\/code> and <code>&lt;<\/code> are written as <code>&amp;amp;<\/code> and <code>&amp;lt;<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Which elements and attributes a document may contain can also be defined with a schema (XSD or DTD); a document that matches its schema is called <strong>valid XML<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Difference_Between_XML_HTML_and_JSON\"><\/span>The Difference Between XML, HTML and JSON<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"snc-table-wrap\"><table>\n<thead><tr><th><\/th><th>XML<\/th><th>HTML<\/th><th>JSON<\/th><\/tr><\/thead>\n<tbody>\n<tr><td><strong>Purpose<\/strong><\/td><td>Structuring and transporting data<\/td><td>Displaying a web page<\/td><td>Transporting data (especially in APIs)<\/td><\/tr>\n<tr><td><strong>Tags<\/strong><\/td><td>User-defined<\/td><td>Predefined (p, div, a&#8230;)<\/td><td>No tags; key-value pairs<\/td><\/tr>\n<tr><td><strong>Rules<\/strong><\/td><td>Strict; does not tolerate errors<\/td><td>Browsers tolerate errors<\/td><td>Strict syntax<\/td><\/tr>\n<tr><td><strong>Size \/ readability<\/strong><\/td><td>Longer<\/td><td>&#8211;<\/td><td>Shorter, easy to process in programs<\/td><\/tr>\n<tr><td><strong>Extra features<\/strong><\/td><td>Schema validation, namespaces, attributes<\/td><td>&#8211;<\/td><td>Built-in number, boolean and array types<\/td><\/tr>\n<\/tbody><\/table><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">New web APIs mostly prefer JSON; XML is common in document formats, official data exchange and systems that need schema validation. For JSON see our article what is JSON, and for HTML <a href=\"https:\/\/sunucun.com.tr\/blog\/html-what\/\">what is HTML<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_Is_XML_Used\"><\/span>Where Is XML Used?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Sitemaps (sitemap.xml):<\/strong> The file that tells search engines about a site&#8217;s pages.<\/li>\n<li><strong>RSS \/ Atom feeds:<\/strong> The new-content feeds of blogs and news sites.<\/li>\n<li><strong>e-Invoices and e-Archive:<\/strong> In T\u00fcrkiye, e-invoice documents are created with an XML-based standard called UBL-TR.<\/li>\n<li><strong>Office documents:<\/strong> .docx, .xlsx and .pptx files are compressed packages that contain XML files.<\/li>\n<li><strong>SVG images:<\/strong> Vector graphics are defined with XML.<\/li>\n<li><strong>Configuration and data exchange:<\/strong> The settings files of many applications, SOAP web services, and integrations in banking and between institutions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Open_an_XML_File\"><\/span>How to Open an XML File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Browser:<\/strong> Drag the .xml file into Chrome, Edge or Firefox; it is shown as a tree.<\/li>\n<li><strong>Text editor:<\/strong> You can open and edit it with Notepad, Notepad++ or Visual Studio Code.<\/li>\n<li><strong>Excel:<\/strong> It can be imported as a table with Data &gt; Get Data &gt; From XML.<\/li>\n<li><strong>e-Invoice XML:<\/strong> Rather than the raw XML, it is opened as a readable invoice with the Revenue Administration (G\u0130B) portal or your integrator&#8217;s viewer.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you are looking for a fast and reliable environment for your site&#8217;s sitemap.xml and your web services, take a look at our <a href=\"https:\/\/sunucun.com.tr\/en\/hosting\/\">hosting<\/a> and <a href=\"https:\/\/sunucun.com.tr\/en\/vps-server\">VPS server<\/a> plans.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Is_XML_a_programming_language\"><\/span>Is XML a programming language?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. XML is a markup language; it describes data but does not do anything by itself. It is the programs that use XML that read and process the data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_the_biggest_difference_between_XML_and_HTML\"><\/span>What is the biggest difference between XML and HTML?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">HTML describes how data should look, while XML describes what the data is. HTML&#8217;s tags are fixed; in XML you define the tags yourself.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_does_my_XML_file_give_an_error\"><\/span>Why does my XML file give an error?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The most common causes are an unclosed tag, wrong nesting, more than one root element, an unescaped &amp; sign in the text, or a mismatch between the encoding in the declaration and the file&#8217;s actual encoding.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>XML, short for Extensible Markup Language, is a markup language used to store and transport data by structuring it with tags in a way that both people and programs can read. It was standardised by the W3C (World Wide Web Consortium); its first version, XML 1.0, was published in 1998. Unlike HTML, it has no&hellip;<\/p>\n","protected":false},"author":1,"featured_media":21198,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1521],"tags":[],"class_list":["post-21881","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teknoloji"],"_links":{"self":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts\/21881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/comments?post=21881"}],"version-history":[{"count":0,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts\/21881\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/media\/21198"}],"wp:attachment":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/media?parent=21881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/categories?post=21881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/tags?post=21881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}