What is XML?
XML (Extensible Markup Language) is a markup language like HTML for storage or transmission of data.XML is widely used in web services to transport data over the network.XML has no predefined tags, unlike HTML. XML is very easy to parse and generate. XML provides strong support for Unicode characters. The default character encoding is UTF-8 for XML documents. XML defines a set of rules for encoding documents in a format which are human-friendly.XML is widely used in a SOA (Services Oriented Architecture). XML files have the extension .xml
and the media types of XML are application/xml
and text/xml
. Almost all major programming languages supports XML due to its language-independent data format.
Features of XML
1 XML separates data from HTML
If you need to display dynamic data in your HTML document, it will take a lot of work to edit the HTML each time the data changes.
With XML, data can be stored in separate XML files. This way you can focus on using HTML/CSS for display and layout, and be sure that changes in the underlying data will not require any changes to the HTML. With a few lines of JavaScript code, you can read an external XML file and update the data content of your web page.
2 XML simplifies data sharing
In the real world, computer systems and databases contain data in incompatible formats.
XML data is stored in plain text format. This provides a software- and hardware-independent way of storing data.
This makes it much easier to create data that can be shared by different applications.
3 XML simplifies data transport
One of the most time-consuming challenges for developers is to exchange data between incompatible systems over the Internet.
Exchanging data as XML greatly reduces this complexity, since the data can be read by different incompatible applications.
XML can be used to create new internet languages
A lot of new Internet languages are created with XML.
Here are some examples:
- XHTML.
- WSDL for describing available web services.
- WAP and WML as markup languages for handheld devices.
- RSS languages for news feeds.
- RDF and OWL for describing resources and ontology.
- SMIL for describing multimedia for the web.
Advantages of XML
Here, pros/benefits of XML:
- It made it easy to transport and share data.
- XML improves the exchange of data between various platforms.
- It is a markup language, which is a set of characters or/and symbols placed in a text document.
- XML indicates how the XML document should look after it is displayed.
- It simplifies the platform change process.
- It enhances data availability.
- It supports multilingual documents and Unicode.
- Provide relatively easy to learn and code.
- It is a markup language, which is a set of characters or/and symbols placed in a text document.
- It performs validation using DTD and Schema.
- Makes documents transportable across systems and applications. With the help of XML, you can exchange data quickly between different platforms.
- XML separates the data from HTML.
Disadvantages of XML
Here are the cons/drawback of using XML:
- XML requires a processing application.
- The XML syntax is similar to another alternative ‘text-based’ data transmission formats, which is sometimes confusing.
- No intrinsic data type support
- The XML syntax is redundant.
- Does not allow the user to create his tags.
Summary
- XML stands for extensible Markup Language. XML is a language (not a programming language) that uses the markup and can extend.
- The main goal is to transport data, not to display data.
- XML 1.1 is the latest version. Yet, XML 1.0 is the most used version.
- Tags work as pairs except for declarations.
- Opening tag + content + closing tag = an element
- Entities are a way of representing special characters.
- DTD stands for Document Type Definition. It defines the structure of an XML document using some legal elements. XML DTD is optional.
- DOM stands for Document Object Model. It defines a standard manner of accessing and manipulating XML documents.
- Well-formed XML documents are XML documents with correct syntax.
- Valid XML documents are well-formed and also conform to the DTD rules.
- Namespaces help to avoid element name conflicts.
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024