XML | XML Basics | XML in Web Design | XML Tags | XML Reserved Symbols

XML | XML Basics | XML in Web Design | XML Tags | XML Reserved Symbols

Extensible Mark-up Language (XML) is derived from SGML (Standard Generalized Mark-up Language). It is a text based mark-up language. It has its own customized tags that contain and organize data in the web page efficiently. XML is highly useful in the creation of large html websites. It simplifies the implementation of document for html websites. It allows us to store and arrange data according to our data handing needs. XML files can easily be merged with CSS files used for styling to give desirable outcome.

XML has 3 main features that makes it highly usable and reliable to use in any solution :

  1. It doesn’t contain any pre-defined tag. It allow us to create our own customized tags that suits our solution description better i.e. XML is extensible.
  2. XML was developed by World Wide Web Consortium (W3C) and is available as open standard i.e. XML follow public standard.
  3. XML is responsible for carrying, storing and managing data. It does not deal with its presentation.

 


XML in Web design

Extensible Mark-up Language or XML is a beneficial tool in web designing that contain data to display on web page as well as instructions and information. XML is highly flexible document that can easily combine with any programming language or database application. XML is an essential tool for web designing because of its basic features:

XML is known for its ease and simplicity with data security. It provides the facility to customize xml elements according to your desire i.e. the page structure depends on your choice.

XML document developer is responsible for xml nodes and xml attributes creation. XML can have meta-data and xml tags, attributes and elements can easily be optimized according to search engine specifications.

The main purpose of xml is to store data that means it focus on the content of the webpage instead of looks while html gives equal importance to presentation and data both. That means only xml has the feature to give full importance to data.

 


Is XML a programming language?

XML is not a programming language. It define set of rules to encode document in human readable and machine understandable format. It neither contain any logic or algorithm nor it perform any computation. XML is written in a simple text file and processed by any software application that is able to interpret xml.

XML declaration is case sensitive. It starts with <?xml?> tag. XML must be written in lower-case in xml tag. <?xml?> tag contain two main attributes: VERSION that tells the current version of xml used in the document and ENCODING that tells the character format used in the xml document.

XML Example:

<? xml version= “1.0” encoding= “UTF-8”?>

<contact-info>

<name>Web Developer</name>

<company> MSA Technosoft </company>

<phone> +91 8802345480 </phone>

<address> New Delhi </address>

</contact-info>

 


XML Tags, XML Nodes

XML tags or XML nodes are customizable. It is enclosed within angular brackets “< >” as in html. Each xml node once start it must have its own closing tag. The names given to xml nodes are case-sensitive.

Syntax:

<?xml version= “1.0” encoding= “UTF-8”?>

<tag1>………..…..<tag2>…..

….<tag3>…………</tag3>…

…..</tag2>…………..</tag1>

We can use attributes in xml tags also but xml attributes are case-sensitive. Same attribute can not carry two different values in xml syntax. The value that xml attribute contain must be kept inside double quotation mark.

Example: <mytag attribute1= “value1”>……..</mytag>

XML is case-sensitive so, every xml tag and attribute must be written carefully. Use of “UTF-8” or “UTF-16” is preferred to avoid character encoding problem in xml document. Whitespace characters are ignored between xml elements or attributes.

 


XML Reserved Symbols

Some symbols are already reserved in XML for its syntax. These symbols have some predefined meaning in xml that we cannot change. We cannot use those symbols in xml document in some other way. If we have to use that symbol we have their alternative to use. Such symbols and their alternatives are as follows:

Less than (<): use &lt; instead of <

Greater than (>): use &gt; instead of >

Ampersand (&): use &amp; instead of &

Apostrophe (): use &apos; instead of ‘

Quotation (): use &quot; instead of “

Categories:   tech blogs

Comments