0% found this document useful (0 votes)
50 views3 pages

XML Stands For Extensible Markup Language

XML stands for Extensible Markup Language. It is a text-based language that allows users to define their own tags to structure data. XML tags identify and organize data but do not specify how to display it like HTML tags. XML has three main characteristics - it is extensible, carries data without presenting it, and is an open standard developed by W3C.

Uploaded by

Archana ARCHANA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

XML Stands For Extensible Markup Language

XML stands for Extensible Markup Language. It is a text-based language that allows users to define their own tags to structure data. XML tags identify and organize data but do not specify how to display it like HTML tags. XML has three main characteristics - it is extensible, carries data without presenting it, and is an open standard developed by W3C.

Uploaded by

Archana ARCHANA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

XML

XML stands for Extensible Markup Language. It is a text-based markup language derived
from Standard Generalized Markup Language (SGML).

XML tags identify the data and are used to store and organize the data, rather than
specifying how to display it like HTML tags, which are used to display the data. XML is
not going to replace HTML in the near future, but it introduces new possibilities by
adopting many successful features of HTML.

There are three important characteristics of XML that make it useful in a variety of
systems and solutions:

XML is extensible: XML allows you to create your own self-descriptive tags or
language, that suits your application.

XML carries the data, does not present it: XML allows you to store the data
irrespective of how it will be presented.

XML is a public standard: XML was developed by an organization called the World Wide
Web Consortium (W3C) and is available as an open standard.
we will discuss the simple syntax rules to write an XML document. Following is a
complete XML document:

<?xml version="1.0"?>
<contact-info>
<name>Tanmay Patil</name>
<company>TutorialsPoint</company>
<phone>(011) 123-4567</phone>
</contact-info>

You can notice, there are two kinds of information in the above example:

The following diagram depicts the syntax rules to write different types of markup and
text in an XML document.
XML Declaration
The XML document can optionally have an XML declaration. It is written as follows:

<?xml version="1.0" encoding="UTF-8"?>

Where version is the XML version and encoding specifies the character encoding used in
the document.

Syntax Rules for XML Declaration


 The XML declaration is case sensitive and must begin with "<?
xml>" where "xml" is written in lower-case.

 If the document contains XML declaration, then it strictly needs


to be the first statement of the XML document.

 The XML declaration strictly needs be the first statement in the XML document.

 An HTTP protocol can override the value of encoding that you


put in the XML declaration.
Tags and Elements
An XML file is structured by several XML-elements, also called XML-nodes
or XML-tags. The names of XML-elements are enclosed in triangular
brackets < > as shown below:

<element>

Syntax Rules for Tags and Elements


Element Syntax: Each XML-element needs to be closed either with
start or with end elements as shown below:

<element>....</element>

or in simple-cases, just this way:

<element/>

Nesting of Elements: An XML-element can contain multiple XML-


elements as its children, but the children elements must not overlap. i.e.,
an end tag of an element must have the same name as that of the most
recent unmatched start tag.

The following example shows incorrect nested tags:

<?xml version="1.0"?>
<contact-info>
<company>TutorialsPoint
<contact-info>
</company>

The following example shows correct nested tags:


<?xml version="1.0"?>
<contact-info>
<company>TutorialsPoint</company>
<contact-info>

Root Element: An XML document can have only one root element. For
example, following is not a correct XML document, because both the x and
y elements occur at the top level without a root element:

<x>...</x>
<y>...</y>

The following example shows a correctly formed XML document:

<root>
<x>...</x>
<y>...</y>
</root>

Case Sensitivity: The names of XML-elements are case-sensitive. That


means the name of the start and the end elements need to be exactly in
the same case.

For example, <contact-info> is different from <Contact-Info>.

XML Attributes
An attribute specifies a single property for the element, using a name/value
pair. An XML- element can have one or more attributes. For example:

<a href="http://www.name.com/">Tutorialspoint!</a>

Here href is the attribute name and http://www.tutorialspoint.com/


is attribute value.

 Same attribute cannot have two values in a syntax. The following


example shows incorrect syntax because the attribute b is specified
twice:

<a b="x" c="y" b="z">....</a>

 Attribute names are defined without quotation marks, whereas


attribute values must always appear in quotation marks. Following
example demonstrates incorrect xml syntax:

<a b=x>....</a>

In the above syntax, the attribute value is not defined in quotation marks.

You might also like