What is XML? Difference from HTML language

Do you have any idea of What is Xml ? Well don’t worry! In this article you will know in detail the definition and the differences it has with HTML. In the web pages and in the different designs there is a language of its own. This acronym stands for a set of rules for encoding documents.

What is XML?

what is xml used for
what is xml used for

Design of markup language that allows the definition of custom labels for the description and organization of data. By creating a company page, you are appointing a significant representative of your own brand. The structure, images, text and other principles that constitute it produce part of the reading set, and the computer analyzes it to show the client the site as it is. The XML language is part of this collection.

The XML file is divided into two parts, the preamble and the body. The preamble consists of management metadata, such as XML declarations, optional processing instructions, document type declarations, and comments. The body part consists of two parts, the structure part and the content part (in the form of plain text).

XML design focuses on simplicity, versatility, and ease of use so it can be used for various web services. So much so that there are systems designed to help define XML-based languages ​​and APIs that help process XML data (not to be confused with HTML).

What is HTML?

It is a perceptible document language used to create web pages. Therefore, the formatting commands used in web content refer to its organization and the way it will be displayed in the browser. In other words, the browser reads the document in HTML format and processes it on the screen by examining the HTML elements inserted in the document, which is considered a text file that contains information to be published.

In this way, we can generate an HTML file and a notepad on our computer is used, for example.

The built-in instructions are called elements and show the structure and representation of the document in the browser. These parts consist of tags that define the text format. The tag is usually two times: the start tag and the end tag. For example, to make text bold, use the <strong> tag at the beginning and the </ strong> tag at the end.

what is xml used for
what is xml used for

What are the differences between XML and HTML?

  • XML is text-based with a self-describing structure that can effectively define another markup language.
  • On the other hand, HTML is a predefined language and has a limited capacity.
  • XML provides the logical structure of the document, while the structure.
  • HTML is predefined using the head and body tags.
  • In terms of HTML language, it is not case sensitive.
  • In contrast, XML is case-sensitive.
  • The design focus of HTML is the presentation characteristics of the data.
  • In contrast, XML is data specific.
  • XML does not allow any errors in the code.
  • On the contrary in HTML, some minor errors can be ignored.
  • Spaces in XML are used for specific purposes because it takes into account all characters in HTML, but spaces can be ignored.
  • XML tags must be closed
  • In HTML open tags can work too.
  • In XML the syntax is very important.
  • On the other hand, HTML doesn’t care about this.

XML Features

The main features is that xml splits data from Html. If you have to display dynamic data in an HTML record, you must do a lot of work to edit it every time the data changes. Using XML the data can be grouped into a separate XML file. In this way, you can use HTML for display and layout. Using a few lines of JavaScript code, you can read an external XML file and update the data content of the web page.

XML reduces data exchange

XML data is stored in plain text format, which allows us to store the data in another way. This greatly facilitates the creation of data that can be shared by different applications.

XML reduces platform change

Upgrading to a new system (hardware or software platform) takes a long time. Large amounts of data must be converted and incompatible data is usually lost. XML data is stored in text format. This helps to expand or update new information systems, new applications or new browsers without losing data.

XML widens the availability of data

Different applications can access not only the data in the HTML page, but also the data in the XML data source. Using XML your data can be provided to all kinds of reading machines (handhelds, voice machines, news, etc.), and it can also facilitate access by people with different abilities, for example not seeing.

XML can be used to create new Internet languages

Most of the new languages ​​on the internet are created with this.

  • WSDL
  • WAP and WML
  • RSS (used in news)
  • RDF and OWL
  • SMIL

How to do the opening of XML files?

Although there are readers of such files, such as the XML Explorer, here are three ways to open XML files on your computer.

With notepad (text document)

Since the XML document is plaintext encrypted, you can open Notepad on Windows or a text editor on Mac, click “File” and then “Open.” At the top you will see the message Xml Version = “1.0” encoding = “UTF-8”? > The content of the screen is in XML format.

Tags are used to store data. Note that some tags can be included in other tags thus creating a “tag tree”. For example to create a title tag 2 in bold the format is: <h2> <strong> TITLE </h2>

Using a browser

Right-click on the XML file saved on the computer and then select the “Open with” option, then select the browser to open the file. In this case, you will not be able to edit the document. On the other hand, because the browser uses multiple colors to display the document in text format, you will see it more clearly than in Notepad.

With excel

Since Excel is not an ideal program to read such files you must first open Excel and then open the XML document. When you’re done click “File” and then “Open.” Excel will show you a message the first option is to open as an XML table. Commit and then convert the XML to a table based on the file tag.

Structure of an XML document

The XML document consists of characters and markup data, and the markup consists of tags:

Prologue and body

Components of an XML document

The following components exist in the XML document:

Element: The logical part of the label, represented by the text string (data) between the labels. It can have Empty (<br/>) elements. Elements can contain attributes.

Description: Process special orders for this application <? xml-stylesheet type = “text / css” href = “style.css”>

XML instructions. They use <? Are they? final. Note: Information that is not part of the document. They are <! -Start and end with ->.

Type declaration: specify information about the document: <! DOCTYPE “person.dtd” personnel system>

CDATA section: this is a set of characters that the processor should not interpret: <! [CDATA [Any character, such as <, &,>, … can be inserted here without being interpreted as tags]]>

XML syntax

Note: Information that is not part of the document.

Type declaration: specify information about the document:

CDATA section: this is a set of characters that the processor should not interpret: <! [CDATA [Any character, such as <, &,>, … can be inserted here without being interpreted as tags]]>

All elements must be nested.

All attribute values ​​must be in quotes.

Good construction standards

  • The first letter of the name will be capitalized.
  • Compound names will be written together or separated by a dash under Corkscrew.
  • The element must start with a non-numeric character or “_”

Good Construction Standards II

There are two types:

  • Orientation to the presentation that is this.
  • And not orientation to the presentation that is this is the most recommended:

HTML language

Well we will talk a little more about the HTML language. This is the language with which they create web pages, mainly it is a group of tags that are used to define text and other elements that make up a web page, such as images, lists, videos, etc.

HTML was originally created for the purpose of providing information including text and some images. I don’t think it will be used to create a multimedia consulting and leisure area (currently the web), so when creating HTML I did not answer all the possible uses that will be used. All the people who will use it in the future. However despite the bad plan, if any changes are made over time, these are HTML standards.

HTML is an element markup language for creating hypertext documents. It is very easy to learn and allows anyone even if they have not written a program to face the task of creating a website. HTML is easy and we can quickly master the language. Later due to our design capabilities and artistic talents, as well as the combination of other languages ​​to define the format that the website should present (such as CSS), we can get professional results.

This language is written in text documents so we need a text editor to write web pages. Therefore a file that contains HTML code is a special text file with an extension of .html or .htm (it doesn’t matter which one is used). Therefore when we use HTML for programming, we will use a text editor to do it, the editor should be as simple as possible and we will use the .html extension to save our work, such as mypage.html.

To understand a little how to use HTML, we will tell you that the language consists of tags in the form of <B> or <P>. Each mark represents one thing, for example, <B> means that it is written in bold, or <P> means a paragraph, and <A> is a link, etc. Almost all tags have their corresponding end tags, indicating that the tag should not affect the tag after this.

For example, </B> is used to indicate that you no longer type in bold. Therefore, HTML is nothing more than a series of tags that define the content of the document and some basic styles. <B> Bold </B>. An important note this is not case sensitive. That is why the most common is that developers write these labels in lowercase.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button