<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ xml - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ xml - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 31 May 2026 22:33:07 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/xml/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ XML Formatting in Notepad++ – How to Format XML Files ]]>
                </title>
                <description>
                    <![CDATA[ If you're working with XML files in Notepad++, formatting them manually could be a cumbersome task especially if the XML files are large. In this article, I will show you how to format your XML files in a few clicks. I will also show you how to check... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/xml-formatting-in-notepad-how-to-format-xml-files/</link>
                <guid isPermaLink="false">66adf295007ea266ef6d924e</guid>
                
                    <category>
                        <![CDATA[ xml ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Wed, 03 May 2023 12:41:46 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/05/Copy-of-matchPunctuationRegEx.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're working with XML files in Notepad++, formatting them manually could be a cumbersome task especially if the XML files are large.</p>
<p>In this article, I will show you how to format your XML files in a few clicks. I will also show you how to check that the syntax of the XML files is in the right order and all tags are closed.</p>
<h2 id="heading-how-to-format-xml-files-in-notepad">How to Format XML Files in Notepad++</h2>
<p>You can see that the XML file below is not well formatted at all. With the file, I'll demonstrate how to format any XML file in Notepad++:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/05/unformattedxmlfile-1.gif" alt="unformattedxmlfile-1" width="600" height="400" loading="lazy"></p>
<p><strong>Step 1</strong>: Open your XML file with Notepad++ if you don't have it opened already:
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss1.png" alt="ss1" width="600" height="400" loading="lazy"> </p>
<p><strong>Step 2</strong>: In the menu bar, click on "Plugins" and select "Plugins Admin":
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss2.png" alt="ss2" width="600" height="400" loading="lazy"> </p>
<p><strong>Step 3</strong>: Search for "xml tools", checkmark it in the search results, click install, and select "Yes":
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss3.png" alt="ss3" width="600" height="400" loading="lazy"> </p>
<p>The plugin will be downloaded and Notepad++ will restart:
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss4.png" alt="ss4" width="600" height="400" loading="lazy"> </p>
<p><strong>Step 4</strong>: Click "Plugins" again in the menu bar, hover on "XML Tools", and click "Pretty print" to format the XML file:
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss5.png" alt="ss5" width="600" height="400" loading="lazy"> </p>
<p>Now, the XML file is well formatted:
<img src="https://www.freecodecamp.org/news/content/images/2023/05/formattedxmlfile.gif" alt="formattedxmlfile" width="600" height="400" loading="lazy"> </p>
<p>Alternatively, you can press <code>CTRL + ALT + SHIFT + B</code> to do the same thing.</p>
<h2 id="heading-how-to-check-xml-syntax-with-notepad">How to Check XML Syntax with Notepad++</h2>
<p>If your XML file is really large, the syntax might be bad, and some tags might be missing closing tags. </p>
<p>You can check the syntax with the same XML Tools plugin and it will suggest what you have to do if it finds that anything is wrong.</p>
<p>Again, click "Plugins", hover on "XML Tools" and select "Check XML syntax now":
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss6.png" alt="ss6" width="600" height="400" loading="lazy"> </p>
<p>Now, it's showing me I didn’t close one of the tags:
<img src="https://www.freecodecamp.org/news/content/images/2023/05/ss7.png" alt="ss7" width="600" height="400" loading="lazy"> </p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article showed you how to format your XML files inside Notepad++ with the XML Tools plugin. As already stated, this can be useful if you have to work with large XML files inside Notepad++.</p>
<p>The XML Tools plugin is a great tool for working with XML files in Notepad++ as it gives you a good user experience with XML files. For more information, you can hover on it and see a couple of other useful things you can do with it.</p>
<p>Keep coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Open an XML File ]]>
                </title>
                <description>
                    <![CDATA[ XML stands for eXtensible Markup Language. XML files are readable files that describe the structure of data. You store XML files with the .xml extension. An XML file contains tags that specify how the document should be structured and how it should b... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-open-an-xml-file/</link>
                <guid isPermaLink="false">66d45fab3dce891ac3a9680c</guid>
                
                    <category>
                        <![CDATA[ beginner ]]>
                    </category>
                
                    <category>
                        <![CDATA[ markup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ xml ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Joel Olawanle ]]>
                </dc:creator>
                <pubDate>Thu, 27 Oct 2022 18:58:02 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/10/cover-template--18-.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>XML stands for e<strong>X</strong>tensible <strong>M</strong>arkup <strong>L</strong>anguage. XML files are readable files that describe the structure of data. You store XML files with the <code>.xml</code> extension.</p>
<p>An XML file contains tags that specify how the document should be structured and how it should be stored and transmitted over the internet.</p>
<p>It is no longer the preferred method for organizing and transmitting data, but many legacy systems still use it. Also, both RSS and SVG are based on the XML format.</p>
<p>This is how XML appears:</p>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">catalog</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">book</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"bk1"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">author</span>&gt;</span>Corets, Eva<span class="hljs-tag">&lt;/<span class="hljs-name">author</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Maeve Ascendant<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">genre</span>&gt;</span>Fantasy<span class="hljs-tag">&lt;/<span class="hljs-name">genre</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>5.95<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">book</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">book</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"bk2"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">author</span>&gt;</span>Corets, Eva<span class="hljs-tag">&lt;/<span class="hljs-name">author</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Oberon's Legacy<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">genre</span>&gt;</span>Fantasy<span class="hljs-tag">&lt;/<span class="hljs-name">genre</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>5.95<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">book</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">book</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"bk3"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">author</span>&gt;</span>Corets, Eva<span class="hljs-tag">&lt;/<span class="hljs-name">author</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>The Sundered Grail<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">genre</span>&gt;</span>Fantasy<span class="hljs-tag">&lt;/<span class="hljs-name">genre</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>5.95<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">book</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">catalog</span>&gt;</span>
</code></pre>
<p>In this article, you will learn the various ways you can open an XML file, either on your computer or online.</p>
<h2 id="heading-how-to-open-an-xml-file-using-a-text-editor">How to Open an XML File Using a Text Editor</h2>
<p>You must have an XML file you are trying to open, either to view only or to view and edit.</p>
<p>If you want to open an XML file and edit it, you can use a text editor. You can use default text editors, which come with your computer, like Notepad on Windows or TextEdit on Mac.</p>
<p>All you have to do is locate the XML file, right-click the XML file, and select the "Open With" option. This will display a list of programs to open the file.</p>
<p><img src="https://paper-attachments.dropboxusercontent.com/s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666877244802_image.png" alt="s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666877244802_image" width="1968" height="912" loading="lazy"></p>
<p>Select Notepad if it is a Windows computer or TextEdit if it is a Mac computer, as shown in the image above. These two are pre-installed text editors for each operating system and should already be on the list. Any basic text editor will work.</p>
<p>You can use other text editors like <a target="_blank" href="https://code.visualstudio.com/">VSCode</a> (which is suggested on the image above), <a target="_blank" href="https://atom.io/">Atom</a>, <a target="_blank" href="https://www.sublimetext.com/">Sublime Text</a> and others. But it is always best to use default editors for basic tasks like this, as text editors like VSCode, Atom, and Sublime Text are pretty heavy programs.</p>
<h2 id="heading-how-to-open-an-xml-file-using-a-browser">How to Open an XML File Using a Browser</h2>
<p>If you only want to view the file, you can use any web browser such as Safari, Chrome, and lots more with similar procedures.</p>
<p>The first step is to locate the XML file you want to open, right-click the file, and select the “open with” option. A list of options will appear, including some browsers.</p>
<p><img src="https://paper-attachments.dropboxusercontent.com/s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878064357_image.png" alt="s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878064357_image" width="1968" height="912" loading="lazy"></p>
<p>Click on your preferred browser, and then your XML will load up.</p>
<p>Another option would be to open your browser and then drag the XML file to the browser. This also works for text editors.</p>
<h2 id="heading-how-to-open-an-xml-file-online">How to Open an XML File Online</h2>
<p>On the internet, dozens of XML viewers and even converters help convert XML files to other formats like JSON. Here are some of the most popular online XML viewers/editors:</p>
<ul>
<li><p><a target="_blank" href="https://codebeautify.org/xmlviewer">Code Beautify</a></p>
</li>
<li><p><a target="_blank" href="https://jsonformatter.org/xml-viewer">JSON Formatter</a></p>
</li>
<li><p><a target="_blank" href="https://www.tutorialspoint.com/online_xml_editor.htm">Tutorialspoint</a></p>
</li>
<li><p><a target="_blank" href="https://jsonformatter.org/xml-viewer">JSON Formatter</a></p>
</li>
<li><p><a target="_blank" href="https://chrome.google.com/webstore/detail/xml-viewer/legopflakafagikcpiapgnbokgkbejlk/related?hl=en">Google Chrome Extension</a></p>
</li>
</ul>
<p>Each one works similarly, allowing you to upload the XML file from your computer.</p>
<p>Chrome has an <a target="_blank" href="https://chrome.google.com/webstore/detail/xml-viewer/legopflakafagikcpiapgnbokgkbejlk?hl=en">XML Viewer</a> extension, which works like all these online XML viewers. All you have to do is download the extension. Then click on it whenever you want to open an XML file.</p>
<p><img src="https://paper-attachments.dropboxusercontent.com/s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878537071_image.png" alt="s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878537071_image" width="2296" height="696" loading="lazy"></p>
<p>Once you click on it, an interface that is easy to navigate will appear with two major options you can use to upload your XML file: From your PC or From your Google Drive.</p>
<p><img src="https://paper-attachments.dropboxusercontent.com/s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878607944_image.png" alt="s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878607944_image" width="2684" height="1364" loading="lazy"></p>
<p>When you select an option, you can search for the file, and within a few milliseconds, your XML file will open in the plain section.</p>
<p><img src="https://paper-attachments.dropboxusercontent.com/s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878725496_image.png" alt="s_6918DB109E81C99C403FDE441785C55AA8E56E1977270D55F040260DC7FE989F_1666878725496_image" width="2374" height="1334" loading="lazy"></p>
<h2 id="heading-ta-da">Ta-da 😂</h2>
<p>In this short article, you have learned how to open an XML file. I hope this will help you.</p>
<p>Have fun coding!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Use SVG Images in CSS and HTML – A Tutorial for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ By Edidiong Asikpo SVG stands for Scalable Vector Graphics. It is a unique type of image format for vector-based graphics written in Extensible Markup Language (XML). In this tutorial, I will explain why you'd want to use SVG images and how you can u... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/use-svg-images-in-css-html/</link>
                <guid isPermaLink="false">66d45e48052ad259f07e4aa5</guid>
                
                    <category>
                        <![CDATA[ CSS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ image ]]>
                    </category>
                
                    <category>
                        <![CDATA[ image optimization  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SVG ]]>
                    </category>
                
                    <category>
                        <![CDATA[ xml ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 16 Nov 2020 22:44:20 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/11/Screen-Shot-2020-11-15-at-3.59.07-PM.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Edidiong Asikpo</p>
<p>SVG stands for Scalable Vector Graphics. It is a unique type of image format for vector-based graphics written in Extensible Markup Language (XML).</p>
<p>In this tutorial, I will explain why you'd want to use SVG images and how you can use them in CSS and HTML.</p>
<h2 id="heading-why-should-you-use-svg-images">Why Should You Use SVG Images?</h2>
<p>There are a number of reasons to use SVG images, some of which are:</p>
<ul>
<li><p>SVG images do not lose their quality when zoomed or resized.</p>
</li>
<li><p>They can be created and edited with an IDE or text editor.</p>
</li>
<li><p>They are accessible and animatable.</p>
</li>
<li><p>They have a small file size and are highly scalable.</p>
</li>
<li><p>And they can be searched, indexed, scripted, and compressed.</p>
</li>
</ul>
<p>Now let's see how you can actually work with SVG images.</p>
<h2 id="heading-how-to-download-the-svg-image-used-in-this-tutorial">How to Download the SVG Image Used in This Tutorial</h2>
<p>If you want to work with the SVG image I've used in this tutorial, follow the steps (and diagram) below to download it.</p>
<ul>
<li><p>Go to <a target="_blank" href="https://undraw.co">unDraw</a>.</p>
</li>
<li><p>Change the background color to yellow.</p>
</li>
<li><p>In the search box, search for the word <strong>happy</strong>.</p>
</li>
</ul>
<p><img src="https://i.imgur.com/ncSY7Rn.png" alt="unDraw's Homepage" width="1836" height="888" loading="lazy"></p>
<ul>
<li><p>Click on the image named <strong>Happy news</strong>.</p>
</li>
<li><p>On the pop-up window, click on the <strong>Download SVG to your projects</strong> button.</p>
</li>
</ul>
<p><img src="https://i.imgur.com/qGrT73n.png" alt="Download the SVG file" width="1336" height="581" loading="lazy"></p>
<p>If you followed the steps above correctly, the SVG image should be on your computer now.</p>
<p><img src="https://i.imgur.com/3uCGy6B.png" alt="Image" width="1003" height="183" loading="lazy"></p>
<p>Now, open the SVG image in your favorite IDE or text editor. Rename it to <strong>happy.svg</strong> or whatever name you prefer.</p>
<h2 id="heading-how-to-use-svg-images-in-css-and-html">How to Use SVG Images in CSS and HTML</h2>
<p>There are several different ways to use SVG images in CSS and HTML. We will explore six different methods in this tutorial.</p>
<h3 id="heading-1-how-to-use-an-svg-as-an">1. How to use an SVG as an <code>&lt;img&gt;</code></h3>
<p>This method is the simplest way to add SVG images to a webpage. To use this method, add the <code>&lt;img&gt;</code> element to your HTML document and reference it in the <code>src</code> attribute, like this:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span> = <span class="hljs-string">"happy.svg"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"My Happy SVG"</span>/&gt;</span>
</code></pre>
<p>Assuming you downloaded the SVG image from unDraw and renamed it to <strong>happy.svg</strong>, you can go ahead and add the code snippet above into your HTML document.</p>
<p>If you did everything correctly, your webpage should look exactly like the demo below. 👀</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-mppxs?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<p>When you add an SVG image using the <code>&lt;img&gt;</code> tag without specifying the size, it assumes the size of the original SVG file.</p>
<p>For instance, in the demo above, I didn't modify the size of the SVG image, so it assumed its original size (which was a width of <code>915.11162px</code> and a height of <code>600.53015px</code> ).</p>
<p><strong>Note:</strong> to change the original size, you have to specify the <code>width</code> and <code>height</code> with CSS as you can see in the demo below. You can also update the original <code>width</code> and <code>height</code> directly.</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-1-ey5me?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<p>Even though we can change the size of SVG images added via the <code>&lt;img&gt;</code> tag, there are still some restrictions if you want to make major style changes to the SVG image.</p>
<h3 id="heading-2-how-to-use-svg-as-a-css-background-image">2. How to use SVG as a CSS <code>background-image</code></h3>
<p>This is similar to adding SVG to an HTML document using the <code>&lt;img&gt;</code> tag. But this time we do it with CSS instead of HTML as you can see in the code snippet below.</p>
<pre><code class="lang-bash">body {
  background-image: url(happy.svg);
}
</code></pre>
<p>When you use an SVG as a CSS background image, it has similar limitations to using <code>&lt;img&gt;</code>. Still, it allows a bit more customization.</p>
<p>Check out the demo below and feel free to make modifications to it using CSS.</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-2-ftn6n?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<h3 id="heading-3-how-to-use-inline-svg-images">3. How to use inline SVG images</h3>
<p>SVG images can be written directly into the HTML document using the<code>&lt;svg&gt; &lt;/svg&gt;</code> tag.</p>
<p>To do this, open the SVG image in VS code or your preferred IDE, copy the code, and paste it inside the <code>&lt;body&gt;</code> element in your HTML document.</p>
<pre><code class="lang-bash">&lt;body&gt;
 // Paste the SVG code here.
&lt;/body&gt;
</code></pre>
<p>If you did everything correctly, your webpage should look exactly like the demo below.</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-3-zunkd?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<p>When you use SVG inline in the HTML document, it reduces load time because it serves as an HTTP request.</p>
<p>Using this method lets you perform more customization as opposed to using either the <code>&lt;img&gt;</code> or <code>background-image</code> methods.</p>
<h3 id="heading-4-how-to-use-an-svg-as-an">4. How to use an SVG as an <code>&lt;object&gt;</code></h3>
<p>You can also use an HTML <code>&lt;object&gt;</code> element to add SVG images to a webpage using the code syntax below:</p>
<pre><code class="lang-bash">&lt;object data=<span class="hljs-string">"happy.svg"</span> width=<span class="hljs-string">"300"</span> height=<span class="hljs-string">"300"</span>&gt; &lt;/object&gt;
</code></pre>
<p>You use the <code>data</code> attribute to specify the URL of the resource that you'll use by the object, which is the SVG image in our case.</p>
<p>You use the <code>width</code> and <code>height</code> to specify the size of the SVG image.</p>
<p>Again, below is a demo for you to explore. 😃</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-4-3ge0n?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<p>Using the <code>&lt;object&gt;</code> is supported across all browsers that support SVG.</p>
<h3 id="heading-5-how-to-use-svg-as-an">5. How to use SVG as an <code>&lt;iframe&gt;</code></h3>
<p>Even though this isn't advisable, you can also add an SVG image using an <code>&lt;iframe&gt;</code> as seen in the demo below.</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-5-co3hg?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<p>Just keep in mind, though, that <code>&lt;iframe&gt;</code>s can be difficult to maintain and will be bad for your site's Search Engine Optimization (SEO).</p>
<p>Using <code>&lt;iframe&gt;</code> also defeats the purpose of the <em>Scalable</em> in the name <em>Scalable Vector Graphics</em> because SVG images added with this format are not scalable.</p>
<h3 id="heading-6-how-to-use-svg-as-an">6. How to use SVG as an <code>&lt;embed&gt;</code></h3>
<p>The HTML <code>&lt;embed&gt;</code> element is another way to use an SVG image in HTML and CSS using this syntax: <code>&lt;embed src="happy.svg" /&gt;</code>.</p>
<p>Keep in mind, however, that this method has limitations, too. According to MDN, most modern browsers have deprecated and removed support for browser plug-ins. This means that relying upon <code>&lt;embed&gt;</code> is generally not wise if you want your site to be operable on the average user's browser.</p>
<p>Below is a demo of using the HTML <code>&lt;embed&gt;</code> element to add an SVG image.</p>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/svg-demo-6-iwy0s?fontsize=14&amp;hidenavigation=1&amp;theme=dark" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" title="Embedded content" loading="lazy"></iframe></div>

<h2 id="heading-conclusion">Conclusion</h2>
<p>I hope you were able to learn about the different ways of using SVG images in CSS and HTML. This will hopefully guide you towards choosing the right method when adding SVG images to a website.</p>
<p>If you have any questions, you can send me a <a target="_blank" href="https://twitter.com/Didicodes">message on Twitter</a>, and I'll be happy to answer every single one.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is an XML File? How to Open XML Files and the Best XML Viewers ]]>
                </title>
                <description>
                    <![CDATA[ If you've ever seen the .xml extension in your downloads folder and wondered what that is, you're not alone. Keep reading to learn what and XML file is, and how to open it both locally on your computer and in online editors. What's an XML file? XML s... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-an-xml-file-how-to-open-xml-files-and-the-best-xml-viewers/</link>
                <guid isPermaLink="false">66ac883c33a54a9b1a447938</guid>
                
                    <category>
                        <![CDATA[ xml ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kristofer Koishigawa ]]>
                </dc:creator>
                <pubDate>Thu, 10 Sep 2020 17:25:27 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c98bf740569d1a4ca1bd4.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you've ever seen the <code>.xml</code> extension in your downloads folder and wondered what that is, you're not alone.</p>
<p>Keep reading to learn what and XML file is, and how to open it both locally on your computer and in online editors.</p>
<h2 id="heading-whats-an-xml-file">What's an XML file?</h2>
<p>XML stands for Extensible Markup Language and was created by the <a target="_blank" href="https://www.w3.org/">W3C</a> (World Wide Web Consortium) in the 90s.</p>
<p>Though XML, like HTML, is a human readable markup language, they serve very different purposes. HTML describes the structure of a web page and its content, and XML describes the structure of data.</p>
<p>XML provides programs, and more importantly, programmers, a standard, widely accepted format to transmit data across different systems. In that way, XML has more in common with JSON than it does with HTML.</p>
<p>While XML is no longer the preferred method for organizing and transmitting data, it still has its place. XML is still used in many legacy systems, and both RSS and SVG are both based on the XML format.</p>
<p>Here's a simple example of an XML file and how it's used to structure data:</p>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">fcc_merch</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">item</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">name</span>&gt;</span>Triblend T-shirt<span class="hljs-tag">&lt;/<span class="hljs-name">name</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>$24.99<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">description</span>&gt;</span>Represent the freeCodeCamp community with pride in this jet-black Triblend T-shirt featuring the iconic "bonfire function call" logo.<span class="hljs-tag">&lt;/<span class="hljs-name">description</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">item</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">item</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">name</span>&gt;</span>Cotton-Poly Pullover Hoodie<span class="hljs-tag">&lt;/<span class="hljs-name">name</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>$49.99<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">description</span>&gt;</span>Stay toasty and dress like a developer with this jet-black cotton-poly pullover hoodie.<span class="hljs-tag">&lt;/<span class="hljs-name">description</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">item</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">item</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">name</span>&gt;</span>Ceramic Coffee Mug<span class="hljs-tag">&lt;/<span class="hljs-name">name</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">price</span>&gt;</span>$14.99<span class="hljs-tag">&lt;/<span class="hljs-name">price</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">description</span>&gt;</span>Toast to the developer community with your very own freeCodeCamp Bonfire Function Call mug.<span class="hljs-tag">&lt;/<span class="hljs-name">description</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">item</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">fcc_merch</span>&gt;</span>
</code></pre>
<h2 id="heading-how-to-open-an-xml-file-locally">How to open an XML file locally</h2>
<p>Back to your downloads folder and that file with the <code>.xml</code> extension.</p>
<p>If you ever need to open an XML file, you have a lot of options. The big question is whether you need to edit the data in the XML file, or just view it.</p>
<h3 id="heading-view-an-xml-file-in-a-browser">View an XML file in a browser</h3>
<p>If all you need to do is view the data in an XML file, you're in luck. Just about every browser can open an XML file.</p>
<p>In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome".</p>
<p>When you do, the file will open in a new tab. </p>
<p>Here's what the <code>fcc-merch.xml</code> file looks like in Chrome:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-26.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><strong>Note:</strong> Instructions for your operating system may differ slightly.</p>
<h3 id="heading-edit-an-xml-file-in-a-text-editor">Edit an XML file in a text editor</h3>
<p>If you need to edit an XML file locally, or you prefer to view it outside of the browser, the best way to do that is in a text editor.</p>
<p>You have a lot of options depending on your operating system. Here are some common recommendations:</p>
<p><strong>Windows:</strong></p>
<ul>
<li><a target="_blank" href="https://notepad-plus-plus.org/">Notepad++</a></li>
</ul>
<p><strong>Mac/Linux/Windows:</strong></p>
<ul>
<li><a target="_blank" href="https://code.visualstudio.com/">VSCode</a></li>
<li><a target="_blank" href="https://atom.io/">Atom</a></li>
<li><a target="_blank" href="https://www.sublimetext.com/">Sublime Text</a></li>
</ul>
<p>Note that VSCode, Atom, and Sublime Text are pretty heavy programs, especially if all you want to do is edit an XML file. Mac and Linux users may have access to other lightweight text editors like gedit or Leafpad that can open and edit XML files.</p>
<p>If you want to learn how to code, then by all means, try out one of the editors listed above.</p>
<p>Once you've download an editor, you can open the XML file from the editor's GUI like you would any other file.</p>
<p>Here's the same <code>fcc-merch.xml</code> file in VSCode:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-27.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-open-an-xml-file-online">How to open an XML file online</h2>
<p>Opening an XML file online is easy, and the best online XML viewers also function as editors and formatters.</p>
<p>Here are some of the most popular online XML viewers/editors:</p>
<ul>
<li><a target="_blank" href="https://codebeautify.org/xmlviewer">Code Beautify</a></li>
<li><a target="_blank" href="https://jsonformatter.org/xml-viewer">JSON Formatter</a></li>
<li><a target="_blank" href="https://www.tutorialspoint.com/online_xml_editor.htm">Tutorialspoint</a></li>
</ul>
<p>Each one works similarly, allowing you to either upload the XML file from your computer or copy and paste it into the editor on the left:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-24.png" alt="Image" width="600" height="400" loading="lazy">
<em>Code Beautify's XML viewer/editor</em></p>
<p>Once you load your XML, you can click "Tree View" to make it easier to see the hierarchy of your data and how different fields are nested:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-33.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p> Just make any edits you need to in the editor on the left. Then when you're done, just click "Download" to download a copy of your edited file.</p>
<p>Note that your downloaded copy may have a different name like <code>codebeautify.xml</code>. Just rename the file before you attach it to an email, upload it, or whatever it is you need to do.</p>
<h2 id="heading-in-summary">In summary</h2>
<p>The XML format has a long and storied history.</p>
<p>Even though XML files are quite dense compared to modern solutions for data transmission like JSON, it doesn't hurt to know how to open and edit them. Fortunately you've got a lot of options on your local machine and online.</p>
<p>Hope this helps the next time you need to open up or edit an XML file.</p>
<p>Stay safe and happy coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ An Introduction to Extensible Markup Language (XML) ]]>
                </title>
                <description>
                    <![CDATA[ XML stands for eXtensible Markup Language. It is extensible, because unlike HTML, it does not use a predefined set of tags for identifying structural components. Instead, it provides a mechanism for users to define tags themselves.  XML was designed ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/an-introduction-to-extensible-markup-language-xml/</link>
                <guid isPermaLink="false">66c3442193db2451bd441404</guid>
                
                    <category>
                        <![CDATA[ markup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                    <category>
                        <![CDATA[ xml ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 01 Feb 2020 00:00:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9d1f740569d1a4ca3600.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>XML stands for eXtensible Markup Language. It is extensible, because unlike HTML, it does not use a predefined set of tags for identifying structural components. Instead, it provides a mechanism for users to define tags themselves. </p>
<p>XML was designed to simplify data sharing and data transport, and focuses on structuring that information in a logical way.</p>
<h2 id="heading-syntax-of-xml"><strong>Syntax of XML</strong></h2>
<p>The syntax for XML is very straight forward and quite easy to learn. </p>
<p>XML documents must contain one root element that is the parent of all other elements:</p>
<pre><code class="lang-text">&lt;root&gt;
  &lt;child&gt;
    &lt;subchild&gt;.....&lt;/subchild&gt;
  &lt;/child&gt;
&lt;/root&gt;
</code></pre>
<p>Above syntax shows the root element which is necessary while creating an XML code.</p>
<p>But the root element can be called anything. For example:</p>
<pre><code class="lang-text">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;note&gt;
  &lt;to&gt;Tove&lt;/to&gt;
  &lt;from&gt;Jani&lt;/from&gt;
  &lt;heading&gt;Reminder&lt;/heading&gt;
  &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
&lt;/note&gt;
</code></pre>
<p>In the code above <code>&lt;note&gt;</code> is the root element.</p>
<p>Advantages of using XML:</p>
<ul>
<li>Simplicity - XML documents are ordinary text files that can be created and edited with any text editor.</li>
<li>Vendor independence</li>
<li>Platform independence</li>
<li>Extensive infrastructure</li>
</ul>
<p>Disadvantages of using XML:</p>
<ul>
<li>Verbose and cumbersome syntax</li>
<li>Highly inefficient storage</li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
