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

Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 
Data types in php
Data types in phpData types in php
Data types in php
ilakkiya
 

What's hot (20)

Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
DTD
DTDDTD
DTD
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Array in c++
Array in c++Array in c++
Array in c++
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
Dom
DomDom
Dom
 
Php string function
Php string function Php string function
Php string function
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Php array
Php arrayPhp array
Php array
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptx
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Dtd
DtdDtd
Dtd
 
css.ppt
css.pptcss.ppt
css.ppt
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Xml
XmlXml
Xml
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4
 
Data types in php
Data types in phpData types in php
Data types in php
 

Similar to 03 namespace

Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
Erik Hatcher
 
Alfresco Custom Model
Alfresco Custom ModelAlfresco Custom Model
Alfresco Custom Model
Andrea Leo
 

Similar to 03 namespace (20)

Xml part3
Xml part3Xml part3
Xml part3
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
 
WEB PROGRAMMING
WEB PROGRAMMINGWEB PROGRAMMING
WEB PROGRAMMING
 
Alfresco Custom Model
Alfresco Custom ModelAlfresco Custom Model
Alfresco Custom Model
 
Basics of XML
Basics of XMLBasics of XML
Basics of XML
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Xml
XmlXml
Xml
 
Xml andweb services
Xml andweb services Xml andweb services
Xml andweb services
 
Web Information Systems XML
Web Information Systems XMLWeb Information Systems XML
Web Information Systems XML
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
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
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml and webdata
Xml and webdataXml and webdata
Xml and webdata
 
Xml
XmlXml
Xml
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 

More from Baskarkncet (20)

Unit_I.pptx
Unit_I.pptxUnit_I.pptx
Unit_I.pptx
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Unit 1
Unit 1Unit 1
Unit 1
 
HCI
HCIHCI
HCI
 
03 x files
03 x files03 x files
03 x files
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documents
 
00 introduction
00 introduction00 introduction
00 introduction
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
11 deployment diagrams
11 deployment diagrams11 deployment diagrams
11 deployment diagrams
 
10 component diagram
10 component diagram10 component diagram
10 component diagram
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
07 interaction diagrams
07 interaction diagrams07 interaction diagrams
07 interaction diagrams
 
06 class diagrams
06 class diagrams06 class diagrams
06 class diagrams
 
05 use case
05 use case05 use case
05 use case
 
03 unified process
03 unified process03 unified process
03 unified process
 
02 uml
02 uml02 uml
02 uml
 
04 uml diagrams
04 uml diagrams04 uml diagrams
04 uml diagrams
 
01 introduction
01 introduction01 introduction
01 introduction
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

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>