SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
WEB TECHNOLOGY
XML NAMESPACE
What is XML ?
What is Namespace ?
 A namespace is a set of unique names. Namespace is a mechanisms by which
element and attribute name can be assigned to a group. The namespace is identified
by uri(uniform resource identifiers).
Syntax
 The Namespace starts with the keyword xmlns.
 The word name is the Namespace prefix.
 The URL is the Namespace identifier.
<element xmlns:name=“url”>
XML Namespace
<authors>
<author book type=“Classical”>
<title>web</title>
<type>technology</type>
</author>
</author>
<html>
<head>
<title>web technology</title>
</head>
<body>
………
……..
</body>
</html>
Define elements and
attributes that can be
reused in other schemas or
instance documents without
fear of name collisions.
Combine fragments
from different
documents without
any naming
conflicts.
Write reusable code
modules that can be
invoked for specific
elements and
attributes
ADVANTAGES
Namespace allow the browser to:
 Combine various sources of document
 It helps to identify the source of elements or attributes
 UNIFORM RESOURCE LOCATOR(url): contains a reference for a document or an html page on the web
<?xml version = "1.0" encoding = "UTF-8"?>
<sample xmlns:cont = "www.abcd.com">
<cont:name>Gayathri</cont:name>
<cont:company>abcd</cont:company>
<cont:phone>123-4567</cont:phone>
</cont:contact>
Example for Namespace
<bk:authors xmlns:bk=“http://abcd.com”>
<bk:author book type=“classical”>
<bk:title>web</bk:title>
<bk:type>technology</bk:type>
</bk:author>
</bk:author>
We have added the xmlns: (prefix) attribute
to the root element. We have assigned this
attribute a unique value. This unique value is
usually in the form of a url. This defines a
namespace.
And now that the namespace that have been
defined ,we have added a bk prefix to our
eelement names.
Now when we combine the two documents, the
xml processor will see two different element
names: bktitle(from the xml document) and
title(from the html document).
LOCAL NAMESPACE
 OLD
<bk:author xmlns:bk=“www.abcd.com”>
<bk:author booktype=“classical”>
<bk:title>web</bk:title>
<bk:type>technology</bk:type>
</bk:author>
</bk:author>
 New
<author xmlns:bk=“www.abcd.com”>
<author booktype=“classical”>
<bk:title>web</bk:title>
<type>technology</type>
</author>
</author>
Name conflict happened
only for title tag
Add Namespace only for title
tag
Multiple Name Space
<bk:author xmlns :bk=“www.abcd.com”>
<bk:author booktype=“classical”>
<bk:title>web</bk:title>
<bk:type>technology</bk:type>
<pub:author xmlns pub=“www.efg.com”>
</pub:author>
</bk:author>
</bk:author>
Name Space 1 bk
Name Space 2 pub
THANK YOU!
-S.GAYATHRI

More Related Content

PPTX
Introduction to php
PDF
Web Development Course: PHP lecture 1
PPT
XML Schema
PDF
input/ output in java
PPTX
Dom(document object model)
PPT
Entity Relationship Diagram
PPTX
Css position
Introduction to php
Web Development Course: PHP lecture 1
XML Schema
input/ output in java
Dom(document object model)
Entity Relationship Diagram
Css position

What's hot (20)

PPT
Introduction to HTML
PDF
jQuery for beginners
PPTX
Complete Lecture on Css presentation
PPT
Java Script ppt
PPTX
Dynamic HTML (DHTML)
PPT
Introduction to PHP
PPTX
PPT
File organization
PPT
Input output streams
PPT
9. Input Output in java
PPTX
Cascading style sheets (CSS-Web Technology)
PDF
PHP and Mysql
PPTX
Cascading Style Sheet (CSS)
PDF
Object oriented databases
PPTX
An Overview of HTML, CSS & Java Script
PPTX
Referential integrity
PPTX
Document Object Model (DOM)
PPT
Introduction to java beans
PPTX
File Organization
Introduction to HTML
jQuery for beginners
Complete Lecture on Css presentation
Java Script ppt
Dynamic HTML (DHTML)
Introduction to PHP
File organization
Input output streams
9. Input Output in java
Cascading style sheets (CSS-Web Technology)
PHP and Mysql
Cascading Style Sheet (CSS)
Object oriented databases
An Overview of HTML, CSS & Java Script
Referential integrity
Document Object Model (DOM)
Introduction to java beans
File Organization
Ad

Similar to Xml namespace (20)

PPTX
Xml part3
PDF
XML Bible
PPT
03 namespace
PPTX
Web Security Extensible Markup Language.pptx
PPTX
WEB PROGRAMMING
DOC
Web Technology XML Attributes and elementsUnit 3.doc
PPT
1 xml fundamentals
PPTX
Introduce to XML
PDF
xml introduction in web technologies subject
PPTX
PPT
4 xml namespaces and xml schema
PPTX
Unit-2_XMxvvxvxvxvLccccccccccccccccccccccccccc.pptx
PDF
WT UNIT-2 XML.pdf
PPT
51095137-Semantic-WEB.ppt
PPT
Extensible Markup Language - XML || Presentation
PPTX
xml.pptx
PPTX
Xml andweb services
PPT
XML Presentation-2
PPT
Introduction to XML
Xml part3
XML Bible
03 namespace
Web Security Extensible Markup Language.pptx
WEB PROGRAMMING
Web Technology XML Attributes and elementsUnit 3.doc
1 xml fundamentals
Introduce to XML
xml introduction in web technologies subject
4 xml namespaces and xml schema
Unit-2_XMxvvxvxvxvLccccccccccccccccccccccccccc.pptx
WT UNIT-2 XML.pdf
51095137-Semantic-WEB.ppt
Extensible Markup Language - XML || Presentation
xml.pptx
Xml andweb services
XML Presentation-2
Introduction to XML
Ad

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Types and Its function , kingdom of life
PDF
Sports Quiz easy sports quiz sports quiz
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Classroom Observation Tools for Teachers
O7-L3 Supply Chain Operations - ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
Microbial disease of the cardiovascular and lymphatic systems
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Microbial diseases, their pathogenesis and prophylaxis
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
VCE English Exam - Section C Student Revision Booklet
O5-L3 Freight Transport Ops (International) V1.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
RMMM.pdf make it easy to upload and study
PPH.pptx obstetrics and gynecology in nursing
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Types and Its function , kingdom of life
Sports Quiz easy sports quiz sports quiz
FourierSeries-QuestionsWithAnswers(Part-A).pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

Xml namespace

  • 3. What is Namespace ?  A namespace is a set of unique names. Namespace is a mechanisms by which element and attribute name can be assigned to a group. The namespace is identified by uri(uniform resource identifiers).
  • 4. Syntax  The Namespace starts with the keyword xmlns.  The word name is the Namespace prefix.  The URL is the Namespace identifier. <element xmlns:name=“url”>
  • 5. XML Namespace <authors> <author book type=“Classical”> <title>web</title> <type>technology</type> </author> </author> <html> <head> <title>web technology</title> </head> <body> ……… …….. </body> </html>
  • 6. Define elements and attributes that can be reused in other schemas or instance documents without fear of name collisions. Combine fragments from different documents without any naming conflicts. Write reusable code modules that can be invoked for specific elements and attributes ADVANTAGES
  • 7. Namespace allow the browser to:  Combine various sources of document  It helps to identify the source of elements or attributes  UNIFORM RESOURCE LOCATOR(url): contains a reference for a document or an html page on the web <?xml version = "1.0" encoding = "UTF-8"?> <sample xmlns:cont = "www.abcd.com"> <cont:name>Gayathri</cont:name> <cont:company>abcd</cont:company> <cont:phone>123-4567</cont:phone> </cont:contact>
  • 8. Example for Namespace <bk:authors xmlns:bk=“http://abcd.com”> <bk:author book type=“classical”> <bk:title>web</bk:title> <bk:type>technology</bk:type> </bk:author> </bk:author> We have added the xmlns: (prefix) attribute to the root element. We have assigned this attribute a unique value. This unique value is usually in the form of a url. This defines a namespace. And now that the namespace that have been defined ,we have added a bk prefix to our eelement names. Now when we combine the two documents, the xml processor will see two different element names: bktitle(from the xml document) and title(from the html document).
  • 9. LOCAL NAMESPACE  OLD <bk:author xmlns:bk=“www.abcd.com”> <bk:author booktype=“classical”> <bk:title>web</bk:title> <bk:type>technology</bk:type> </bk:author> </bk:author>  New <author xmlns:bk=“www.abcd.com”> <author booktype=“classical”> <bk:title>web</bk:title> <type>technology</type> </author> </author> Name conflict happened only for title tag Add Namespace only for title tag
  • 10. Multiple Name Space <bk:author xmlns :bk=“www.abcd.com”> <bk:author booktype=“classical”> <bk:title>web</bk:title> <bk:type>technology</bk:type> <pub:author xmlns pub=“www.efg.com”> </pub:author> </bk:author> </bk:author> Name Space 1 bk Name Space 2 pub