0% found this document useful (0 votes)
49 views1 page

XML Namespace

The document discusses XML namespaces which allow element and attribute names to be grouped. Namespaces are declared using reserved xmlns attributes and identify the namespace with a URI. An example shows a contact element in the namespace identified by the URI www.tutorialspoint.com/profile with name, company, and phone elements in that namespace.

Uploaded by

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

XML Namespace

The document discusses XML namespaces which allow element and attribute names to be grouped. Namespaces are declared using reserved xmlns attributes and identify the namespace with a URI. An example shows a contact element in the namespace identified by the URI www.tutorialspoint.com/profile with name, company, and phone elements in that namespace.

Uploaded by

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

XML - NAMESPACES

http://www.tutorialspoint.com/xml/xml_namespaces.htm

Copyright tutorialspoint.com

A Namespace is a set of unique names. Namespace is a mechanisms by which element and


attribute name can be assigned to group. The Namespace is identified by URI
UniformResourceIdentifiers.

Namespace Declaration
A Namspace is declared using reserved attributes. Such an attribute name must either be xmlns
or begin with xmlns: shown as below:
<element xmlns:name="URL">

Syntax
The Namespace starts with the keyword xmlns.
The word name is the Namespace prefix.
The URL is the Namespace identifier.

Example
Namespace affects only a limited area in the document. An element containing the declaration
and all of its descendants are in the scope of the Namespace. Following is a simple example of
XML Namespace:
<?xml version="1.0" encoding="UTF-8"?>
<cont:contact xmlns:cont="www.tutorialspoint.com/profile">
<cont:name>Tanmay Patil</cont:name>
<cont:company>TutorialsPoint</cont:company>
<cont:phone>(011) 123-4567</cont:phone>
</cont:contact>

Here, the Namespace prefix is cont, and the Namespace identifier URI as
www.tutorialspoint.com/profile. This means, the element names and attribute names with the cont
prefix includingthecontactelement, all belong to the www.tutorialspoint.com/profile namespace.
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

You might also like