SlideShare a Scribd company logo
1 of 11
Download to read offline
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

Similar to xmlnamespace-2201311329156484688 (1).pdf

Similar to xmlnamespace-2201311329156484688 (1).pdf (20)

Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
ASP.Net Presentation Part2
ASP.Net Presentation Part2ASP.Net Presentation Part2
ASP.Net Presentation Part2
 
Ur Lversus Urn
Ur Lversus UrnUr Lversus Urn
Ur Lversus Urn
 
Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
SCDJWS 6. REST JAX-P
SCDJWS 6. REST  JAX-PSCDJWS 6. REST  JAX-P
SCDJWS 6. REST JAX-P
 
prefix based labelling scheme for xml data
prefix based labelling scheme for xml dataprefix based labelling scheme for xml data
prefix based labelling scheme for xml data
 
Xml
XmlXml
Xml
 
Web services Overview in depth
Web services Overview in depthWeb services Overview in depth
Web services Overview in depth
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
 
Dom
Dom Dom
Dom
 

More from ChetanRaut43

Python 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptxPython 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptxChetanRaut43
 
operatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfoperatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfChetanRaut43
 
OS in 6 hours 640764073707670476407640.pdf
OS in 6 hours 640764073707670476407640.pdfOS in 6 hours 640764073707670476407640.pdf
OS in 6 hours 640764073707670476407640.pdfChetanRaut43
 
AI 838686868686892868255383432434356.pptx
AI 838686868686892868255383432434356.pptxAI 838686868686892868255383432434356.pptx
AI 838686868686892868255383432434356.pptxChetanRaut43
 
operatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxoperatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxChetanRaut43
 
python 165813219816514981616098813219 (1).pptx
python 165813219816514981616098813219 (1).pptxpython 165813219816514981616098813219 (1).pptx
python 165813219816514981616098813219 (1).pptxChetanRaut43
 
IOT 5541434546461631513232138248438.pptx
IOT 5541434546461631513232138248438.pptxIOT 5541434546461631513232138248438.pptx
IOT 5541434546461631513232138248438.pptxChetanRaut43
 
Virtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfVirtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfChetanRaut43
 
Sack TCP Lecture13 all in one easily explain.ppt
Sack TCP Lecture13 all in one easily explain.pptSack TCP Lecture13 all in one easily explain.ppt
Sack TCP Lecture13 all in one easily explain.pptChetanRaut43
 
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onv
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onvC++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onv
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onvChetanRaut43
 

More from ChetanRaut43 (10)

Python 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptxPython 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptx
 
operatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfoperatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdf
 
OS in 6 hours 640764073707670476407640.pdf
OS in 6 hours 640764073707670476407640.pdfOS in 6 hours 640764073707670476407640.pdf
OS in 6 hours 640764073707670476407640.pdf
 
AI 838686868686892868255383432434356.pptx
AI 838686868686892868255383432434356.pptxAI 838686868686892868255383432434356.pptx
AI 838686868686892868255383432434356.pptx
 
operatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxoperatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptx
 
python 165813219816514981616098813219 (1).pptx
python 165813219816514981616098813219 (1).pptxpython 165813219816514981616098813219 (1).pptx
python 165813219816514981616098813219 (1).pptx
 
IOT 5541434546461631513232138248438.pptx
IOT 5541434546461631513232138248438.pptxIOT 5541434546461631513232138248438.pptx
IOT 5541434546461631513232138248438.pptx
 
Virtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdfVirtual Memory 53565686598386865286860.pdf
Virtual Memory 53565686598386865286860.pdf
 
Sack TCP Lecture13 all in one easily explain.ppt
Sack TCP Lecture13 all in one easily explain.pptSack TCP Lecture13 all in one easily explain.ppt
Sack TCP Lecture13 all in one easily explain.ppt
 
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onv
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onvC++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onv
C++ MEMORY MANAGEMENT.pptx/ kbibuvvw veovn nveknev ovne onv
 

Recently uploaded

Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information SystemsAnge Felix NSANZIYERA
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxhublikarsn
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...ssuserdfc773
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessorAshwiniTodkar4
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...ronahami
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 

Recently uploaded (20)

Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 

xmlnamespace-2201311329156484688 (1).pdf

  • 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