Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
xml: added syntax of XML (#9118)
Browse files Browse the repository at this point in the history
Added syntax of XML and examples related to XML root elements.
  • Loading branch information
shashanksh2000 authored and paulywill committed Oct 11, 2018
1 parent d7a0f42 commit 1e63922
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/pages/xml/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ title: Extensible Markup Language (XML)

XML stands for Extensible Markup Language. It is extensible, because it does not use a predefined set of tags for identifying structural components, instead, it provides a mechanism for defining such sets of tags. The main purpose of the language is to share the data. Unlike HTML, in XML there is no predefined set of tags and tags specify meaning, rather than the presentation.

## Syntax of XML
XML syntax refers to the rules that determine how an XML application can be written. The XML syntax is very straight forward, and this makes XML very easy to learn.
XML documents must contain one root element that is the parent of all other elements:

```
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
```
#### XML must have a root element
Above syntax shows the root element which is necessary while creating an XML code. This can be shown by the example:-
```
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
```
In this example 'note' is the root element.


* Advantages of using XML:
* Simplicity - XML documents are ordinary text files that can be created and edited with any text editor.
* Vendor independence
Expand Down

0 comments on commit 1e63922

Please sign in to comment.