Simple “Hello World” program in XML (Extensible Markup Language).
XML stands for Extensible Markup Language. It is a text-based markup language that is both human and machine readable. XML was designed to store and transport data. Unlike HTML, which defines how data is displayed, XML focuses on what the data is. The primary purpose of XML is to structure, store and transport information in a way that is platform independent and easily shareable between systems especially over the internet. A typical use case might involve web services configuration files data exchange between software or even storing structured documents like RSS feeds and SVG graphics.
A simple program "Hello World" is a traditional way to begin learning any new programming or markup language. It is usually the simplest possible program that shows the syntax of the language and demonstrates how to output or represent the phrase:
Hello, World!
XML is not a programming language (i.e., it doesn’t "run" code or perform logic) the "Hello World" example in XML is more about representing or storing the phrase in a structured format. So rather than outputting text to a screen (like in Python or C) XML is used to define data.
<?xml version="1.0" encoding="UTF-8"?> <message>Hello, World!</message>
XML Declaration
<?xml version="1.0" encoding="UTF-8"?>
Root Element
<message>Hello, World!</message>
In real-world scenarios instead of just "Hello World," you might be storing a list of users orders messages or any structured data like:
<user> <id>1</id> <name>SakalaCode</name> <message>Hello, World!</message> </user>
XML helps organize data in a hierarchical structure, which is ideal for representing complex relationships in data.