XML English
XML English
XML English
All the elements that make up a web page are represented through a language that is
interpreted by machines. One of those languages is XML, which is part of what is known as
a markup language or markup language. This way of calling it comes from the ancient
practice of marking manuscripts with certain specifications in the margins to specify some of
its elements. For example, the typography, size or style of the text, so that they were
implemented at the time of printing. With the computer age, the concept moved to the digital
world. XML is then an evolution of markup languages, widely used for creating web pages.
Let us now see its definition and characteristics.
What is XML?
XML stands for Extensible Markup Language, or Extensible Markup Language. Some
specialists define it as a metalanguage, since its main purpose is to transmit information.
A markup language is, after all, the type of language that is encoded or understood by web
browsers. XML and HTML are the most popular. But let's not confuse them with
programming languages, since markup languages don't have arithmetic functions or
variables.
XML is a general purpose markup language, which means that it is not predefined, but you
can set your own tags when developing it, according to your needs, and grow it to where you
need it. Hence the term extensible in its definition.
XML files contain tags that supply specific information, which must be processed by the
developer. The files, in turn, make up XML files.
Something very important to take into account is that in their conformation, XML documents
have to satisfy two basic conditions: to be valid and to be well formed. What does this
mean?
First, to be valid, XML documents must define their semantic rules in an XML schema, in
what is known as a Document Type Definition (DTD). If a tag is not defined, the XML is
considered invalid.
Now, being well-formed means that they must follow the syntax rules of the language, that is,
comply with the training parameters, such as having opening and closing tags. A piece of
information: almost all browsers have a debugger that allows you to identify XML documents
that have errors in their formation.
Its initials refer to Hyper Text Markup Language, or hypertext marking language. It is used in
web pages to define the text contents and how they should be displayed in browsers: if they
are centered, in bold, with links, etc. XML later emerged as the maturity stage of HTML.
Now, we are going to enumerate the main differences between XML and HTML: While the
XML allows the creation of a new markup language according to the needs of the
development, the HTML is predefined, with a limited capacity. The XML establishes the
logical structure of the document. In HTML, the structure is predefined, through the use of
tags, heads and body. HTML emphasizes the characteristics or way of presenting the data.
But XML has more to do with the data itself.
Regarding the language, while with HTML there are no differences if upper and lower case
letters are used, XML does distinguish the use of both types of letters. In this sense, in XML
the blank spaces also have a meaning, since each character has a specific purpose. But in
HTML these spaces can be ignored.
In general, as we have already pointed out, the XML syntax must always be very careful and
respected. On the other hand, in the HTML language this is not a condition of life or death. In
this way, in the XML language, errors in the codes are not admitted, while HTML can allow
some to pass.
In the same sense, we see that XML tags must always be closed, otherwise they throw an
error; but in HTML open tags can still work. When an error occurs, the storage of information
in any programming language is interrupted and processing stops.
Given all these differences between the two languages, let's now examine the benefits that
make the XML language valuable.
XML Benefits
The popularity of XML has a lot to do with its simplicity and ease, which allows it to be used
in different web services. That is why there are systems designed to define languages that
are based on XML and APIs that have as their objective the processing of XML data.
1. Makes it easy to work with dynamic data : Displaying dynamic data in an HTML
document involves a lot of editing work every time that information is changed. But with
XML, you can have that data in separate files and use HTML for layout and display. Similarly,
with JavaScript you can read an external XML file and do the data update on your web page.
2. Simplifies data exchange: In XML, data is stored as plain text, thus opening up a
self-contained pathway for information gathering. In this way, the data can be shared
between different applications and be interpreted in each one, thus solving the problem of
format incompatibility.
3. The change or update of platforms is easier: Also due to the storage of data in text
format, in XML it is easier to assume the update or expansion to other systems, applications
or browsers, without running the risk of losing data. Otherwise, these types of updates can
take a long time to convert large volumes of data.
4. Greater data accessibility: With the XML language, as we have already said, different
applications or systems can read the stored data. In fact, it is considered the easiest and
most reliable way to exchange information between different programs or applications.
5. It allows to create new languages: Many web languages are based on XML. Some of
them are XHTML, WAP and WML, WSDL, RDF and OWL, RSS and SMIL. But one of the
most valuable aspects of the XML language is that, thanks to its extensibility or ability to
adapt to the requirements of each project, XML is a great asset that allows the creation of
new languages. With which, if you train in web programming and web development, you will
be able to create your own language using XML as a base.
1. XML readers: It is the most common way, and they are the specific readers for XML files,
such as XML Explorer.
2. With notepad: In this way, the file is opened as a text document because XML has codes
to be recognized as simple texts. This allows you to open them in notepad, if you're using
Windows, or the text editor, on Mac. First, click File and then Open. When you open the
document, the content identification will appear as XML. You will now be able to read the
tags where the data chunks are stored.
3. With a browser: Right-click the downloaded XML file on your computer, and click “Open
With”. Next, select the browser you prefer. The advantage of this option is that you can view
the file more clearly because the browser identifies different parts of the document with
different colors. The downside is that you won't be able to edit it.
4. With Excel: Open Excel and then the XML document. Click “File” and then click “Open”.
A message will appear with the option to open it as an XML table. Press OK and you will be
able to view the document as a table from the labels.