SlideShare a Scribd company logo
9
Most read
10
Most read
11
Most read
IT6801
SERVICE ORIENTED
ARCHITECTURE
-
UNIT I INTRODUCTION TO XML
XML document structure – Well formed and valid
documents – Namespaces – DTD – XML Schema
– X-Files.
XML Namespaces
Provide a method
to avoid element name conflicts
XML Namespaces
• Multiple XML developers may choose the same element & attribute names 
for their standards
– Each of them, may mean entirely different things. 
• For a processing application, to understand & associate the correct elements, 
– It must know which tag set the elements come from.
• XML Namespaces provide a method to avoid element name 
conflicts.
• Namespaces use a colon-delimited prefix 
To associate external semantics with elements 
– That can be identified via a Universal Resource Identifier (URI).
Example on XML Namespaces
• For instance, this XML carries HTML table information :
• Now, let’s look at another sample XML document
– This XML carries information about a table (a piece of furniture):
<table>
  <name>African Coffee Table</name>
  <width>80</width>
  <length>120</length>
</table>
<table>
  <tr>
    <td>Apples</td>
    <td>Bananas</td>
  </tr>
</table>
• If these XML fragments were added together, 
– There would be a name conflict. 
• Both contain a <table> element, 
– But the elements have different content and meaning.
• By using namespaces,
– XML parsers can easily tell the difference b/w the two <table> elements.
<h:table>
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>
<f:table>
  <f:name>African Coffee Table</f:name>
  <f:width>80</f:width>
  <f:length>120</f:length>
</f:table>
In this example,
there will be no conflict
because the two <table>
elements have different
names.
Declaring Namespaces
• Namespaces can be declared using one of two methods:
1. A default declaration or
2. An explicit declaration.
A Default Declaration
• A default namespace declaration
Specifies a namespace to use for all child elements of the current element
– That do not have a namespace prefix associated with them
• Example :
<Customer xmlns=”http://www.eps-software.com/po”>
<Name>Travis Vandersypen</Name>
<Order>
<Product>
<Name>Hot Dog Buns</Name>
</Product>
</Order>
</Customer>
Default declaration for the <Customer> element is defined
by using the xmlns attribute
All child elements of <Customer> element are
specified as belonging to the
“http://www.eps-software.com/po” namespace
An Explicit Declaration
• This is similar to a default namespace declaration,
– Except a prefix is associated with the xmlns attribute.
• Example : A prefix “po” is with the elements within the document:
<cust:Customer xmlns:cust=“http://www.eps-software.com/customer”
xmlns:ord=“http://www.eps-software.com/order”>
<cust:Name>Travis Vandersypen</cust:Name>
<ord:Order>
<ord:Product>
<ord:Name>Hot Dog Buns</ord:Name>
</ord:Product>
</ord:Order>
</cust:Customer>
Two different namespaces are referenced:
one for customers and one for orders.
This allows a different set of rules to be applied for
customer names versus product names.
Identifying the Scope of Namespaces
• By default,
– All child elements within a parent element appear within the parent’s namespace.
• This allows
– All child elements to “inherit” their parent element’s namespace.
• The “inherited” namespace can be overwritten
– By specifying a new namespace on a particular child element.
Identifying the Scope of Namespaces
• Example:
• <Customer> element declares a default namespace
• <Order> element also declares a default namespace.
• All unqualified elements within the <Order> element will inherit the namespace
declared by the <Order> element.
<Customer xmlns=“http://www.eps-software.com/customer”>
<Name>Travis Vandersypen</Name>
<Order xmlns=“http://www.eps-software.com/order”>
<Product>
<Name>Hot Dog Buns</Name>
</Product>
</Order>
</Customer>

More Related Content

What's hot (20)

PPT
10. XML in DBMS
koolkampus
 
PPTX
XSLT
Kamal Acharya
 
PPT
02 xml schema
Baskarkncet
 
ODP
XML
Osama Qunoo
 
PDF
String operation
Shakila Mahjabin
 
PPTX
SQL Queries Information
Nishant Munjal
 
PPTX
XML-Extensible Markup Language
Ann Joseph
 
PPTX
DTD
Kamal Acharya
 
PPTX
Codd’s rule.pptx
NeeleshBhattacharjee1
 
PPTX
XML Document Object Model (DOM)
BOSS Webtech
 
PPTX
Dynamic HTML (DHTML)
Himanshu Kumar
 
PPTX
XML DTD and Schema
hamsa nandhini
 
PPSX
Parallel Database
VESIT/University of Mumbai
 
PPTX
Oracle Database Introduction
Chhom Karath
 
PPTX
Attributes
Pooja Dixit
 
PPTX
Extensible Markup Language (XML)
AakankshaR
 
PPTX
Session tracking in servlets
vishal choudhary
 
PPTX
View of data DBMS
Rahul Narang
 
DOCX
Concurrency Control Techniques
Raj vardhan
 
PPTX
Normalization Practice case study.pptx
AhmadMirzaAhmad
 
10. XML in DBMS
koolkampus
 
02 xml schema
Baskarkncet
 
String operation
Shakila Mahjabin
 
SQL Queries Information
Nishant Munjal
 
XML-Extensible Markup Language
Ann Joseph
 
Codd’s rule.pptx
NeeleshBhattacharjee1
 
XML Document Object Model (DOM)
BOSS Webtech
 
Dynamic HTML (DHTML)
Himanshu Kumar
 
XML DTD and Schema
hamsa nandhini
 
Parallel Database
VESIT/University of Mumbai
 
Oracle Database Introduction
Chhom Karath
 
Attributes
Pooja Dixit
 
Extensible Markup Language (XML)
AakankshaR
 
Session tracking in servlets
vishal choudhary
 
View of data DBMS
Rahul Narang
 
Concurrency Control Techniques
Raj vardhan
 
Normalization Practice case study.pptx
AhmadMirzaAhmad
 

Similar to 03 namespace (20)

PPTX
Soa unit-1-xml namespaces 09.07.2019
Ramco Institute of Technology, Rajapalayam, Tamilnadu, India
 
PPTX
WEB PROGRAMMING
sweetysweety8
 
PPTX
Xml part3
NOHA AW
 
PPT
4 xml namespaces and xml schema
gauravashq
 
PPTX
Xml andweb services
ayushagrawal464
 
PPT
1 xml fundamentals
Dr.Saranya K.G
 
PPTX
Web Security Extensible Markup Language.pptx
SidduSKamatar
 
PDF
xmlnamespace-2201311329156484688 (1).pdf
ChetanRaut43
 
PPTX
Web Service Workshop - 3 days
David Ionut
 
PPTX
Xml
Yoga Raja
 
DOC
Web Technology XML Attributes and elementsUnit 3.doc
uthayashangar1
 
PDF
XML Bible
LiquidHub
 
PPTX
Introduce to XML
videde_group
 
PPT
Xml and webdata
Harry Potter
 
PPT
Xml and webdata
Luis Goldster
 
PPT
Xml and webdata
Young Alista
 
PPT
Xml and webdata
James Wong
 
PPT
Xml and webdata
Tony Nguyen
 
PPT
Xml and webdata
Fraboni Ec
 
PPT
Xml and webdata
Hoang Nguyen
 
WEB PROGRAMMING
sweetysweety8
 
Xml part3
NOHA AW
 
4 xml namespaces and xml schema
gauravashq
 
Xml andweb services
ayushagrawal464
 
1 xml fundamentals
Dr.Saranya K.G
 
Web Security Extensible Markup Language.pptx
SidduSKamatar
 
xmlnamespace-2201311329156484688 (1).pdf
ChetanRaut43
 
Web Service Workshop - 3 days
David Ionut
 
Web Technology XML Attributes and elementsUnit 3.doc
uthayashangar1
 
XML Bible
LiquidHub
 
Introduce to XML
videde_group
 
Xml and webdata
Harry Potter
 
Xml and webdata
Luis Goldster
 
Xml and webdata
Young Alista
 
Xml and webdata
James Wong
 
Xml and webdata
Tony Nguyen
 
Xml and webdata
Fraboni Ec
 
Xml and webdata
Hoang Nguyen
 
Ad

More from Baskarkncet (19)

PPTX
Unit_I.pptx
Baskarkncet
 
PPTX
Cocomo model
Baskarkncet
 
PPTX
Unit 1
Baskarkncet
 
PPT
HCI
Baskarkncet
 
PPT
03 x files
Baskarkncet
 
PPT
02 well formed and valid documents
Baskarkncet
 
PPT
00 introduction
Baskarkncet
 
PPT
01 xml document structure
Baskarkncet
 
PPT
11 deployment diagrams
Baskarkncet
 
PPT
10 component diagram
Baskarkncet
 
PPT
09 package diagram
Baskarkncet
 
PPT
08 state diagram and activity diagram
Baskarkncet
 
PPT
07 interaction diagrams
Baskarkncet
 
PPT
06 class diagrams
Baskarkncet
 
PPT
05 use case
Baskarkncet
 
PPT
03 unified process
Baskarkncet
 
PPT
02 uml
Baskarkncet
 
PPT
04 uml diagrams
Baskarkncet
 
PPT
01 introduction
Baskarkncet
 
Unit_I.pptx
Baskarkncet
 
Cocomo model
Baskarkncet
 
Unit 1
Baskarkncet
 
03 x files
Baskarkncet
 
02 well formed and valid documents
Baskarkncet
 
00 introduction
Baskarkncet
 
01 xml document structure
Baskarkncet
 
11 deployment diagrams
Baskarkncet
 
10 component diagram
Baskarkncet
 
09 package diagram
Baskarkncet
 
08 state diagram and activity diagram
Baskarkncet
 
07 interaction diagrams
Baskarkncet
 
06 class diagrams
Baskarkncet
 
05 use case
Baskarkncet
 
03 unified process
Baskarkncet
 
02 uml
Baskarkncet
 
04 uml diagrams
Baskarkncet
 
01 introduction
Baskarkncet
 
Ad

Recently uploaded (20)

PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
Hashing Introduction , hash functions and techniques
sailajam21
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 

03 namespace

  • 2. UNIT I INTRODUCTION TO XML XML document structure – Well formed and valid documents – Namespaces – DTD – XML Schema – X-Files.
  • 3. XML Namespaces Provide a method to avoid element name conflicts
  • 4. XML Namespaces • Multiple XML developers may choose the same element & attribute names  for their standards – Each of them, may mean entirely different things.  • For a processing application, to understand & associate the correct elements,  – It must know which tag set the elements come from. • XML Namespaces provide a method to avoid element name  conflicts. • Namespaces use a colon-delimited prefix  To associate external semantics with elements  – That can be identified via a Universal Resource Identifier (URI).
  • 5. Example on XML Namespaces • For instance, this XML carries HTML table information : • Now, let’s look at another sample XML document – This XML carries information about a table (a piece of furniture): <table>   <name>African Coffee Table</name>   <width>80</width>   <length>120</length> </table> <table>   <tr>     <td>Apples</td>     <td>Bananas</td>   </tr> </table>
  • 6. • If these XML fragments were added together,  – There would be a name conflict.  • Both contain a <table> element,  – But the elements have different content and meaning. • By using namespaces, – XML parsers can easily tell the difference b/w the two <table> elements. <h:table>   <h:tr>     <h:td>Apples</h:td>     <h:td>Bananas</h:td>   </h:tr> </h:table> <f:table>   <f:name>African Coffee Table</f:name>   <f:width>80</f:width>   <f:length>120</f:length> </f:table> In this example, there will be no conflict because the two <table> elements have different names.
  • 7. Declaring Namespaces • Namespaces can be declared using one of two methods: 1. A default declaration or 2. An explicit declaration.
  • 8. A Default Declaration • A default namespace declaration Specifies a namespace to use for all child elements of the current element – That do not have a namespace prefix associated with them • Example : <Customer xmlns=”http://www.eps-software.com/po”> <Name>Travis Vandersypen</Name> <Order> <Product> <Name>Hot Dog Buns</Name> </Product> </Order> </Customer> Default declaration for the <Customer> element is defined by using the xmlns attribute All child elements of <Customer> element are specified as belonging to the “http://www.eps-software.com/po” namespace
  • 9. An Explicit Declaration • This is similar to a default namespace declaration, – Except a prefix is associated with the xmlns attribute. • Example : A prefix “po” is with the elements within the document: <cust:Customer xmlns:cust=“http://www.eps-software.com/customer” xmlns:ord=“http://www.eps-software.com/order”> <cust:Name>Travis Vandersypen</cust:Name> <ord:Order> <ord:Product> <ord:Name>Hot Dog Buns</ord:Name> </ord:Product> </ord:Order> </cust:Customer> Two different namespaces are referenced: one for customers and one for orders. This allows a different set of rules to be applied for customer names versus product names.
  • 10. Identifying the Scope of Namespaces • By default, – All child elements within a parent element appear within the parent’s namespace. • This allows – All child elements to “inherit” their parent element’s namespace. • The “inherited” namespace can be overwritten – By specifying a new namespace on a particular child element.
  • 11. Identifying the Scope of Namespaces • Example: • <Customer> element declares a default namespace • <Order> element also declares a default namespace. • All unqualified elements within the <Order> element will inherit the namespace declared by the <Order> element. <Customer xmlns=“http://www.eps-software.com/customer”> <Name>Travis Vandersypen</Name> <Order xmlns=“http://www.eps-software.com/order”> <Product> <Name>Hot Dog Buns</Name> </Product> </Order> </Customer>