SlideShare a Scribd company logo
1 of 21
XML
Web Information Systems - 2015
XML
 eXtensible Markup Language
 w3c standard
 Why?
 Store and transport data
 Easy data exchange
 Create more languages
 WSDL (Web Service Description Language)
 RDF (Resource Description Framework)
 RSS (Really Simple Syndication)
 Self-describing data
 Easy to learn
 Must learn
3 Major Components
 XML
 XSL (eXtensible Stylesheet Language)
 Style sheet language for XML documents
 XSD (XML Schema Definition)
 Describes the structure of an XML document
XML Document
<?xml version="1.0"?>
<!-- this is a sample -->
<note>
<to>Tove</to>
<from source=”contacts”>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Processing Instruction
Comment
Element
Attribute
XML Documents
 Well formed and Valid
 Well formed
 Should only contain one root element
 All tags should have corresponding end tag
 Tags never overlap(<author><name> …
</author></name>)
 Attributes must be quoted
 Valid
 Must be well formed and conforms to the schema
XML Documents
 Has tree structure
 Tags are case sensitive
 <name> is different from <Name>
 Comments
<!-- this is a comment -->
XML Elements
 Can contain
 Other elements
 Text
 Attributes
 Valid names
 <name>, <first_name>, <first2names>
 Invalid names
 <2nd_name>, <$amount>, <first name>
XML elements and Attributes
 Data goes as elements
 <person><name>john</name></person>
 Meta data goes as attributes
 <image type='gif'><name>graph.gif</name></image>
1.0 vs 1.1
• 1.0 – everything not permitted is forbidden
• 1.1 – everything not forbidden is permitted
• 1.0 is compatible with 1.1, not vise-versa
• Forward compatible
• Does not affect to English documents
XML Namespaces
 There can be common elements in multiple domains
 File in hardware and office
<file>
<length>18</length>
<price>3.69</price>
<file>
<file>
<content>Employee data</content>
<numberOfPages>25</numberOfPages>
</file>
XML Namespaces
 How to distinguish?
 Solution : namespaces
<h:file xmlns:h="http://www.hardware.com/">
<h:length>18</h:length>
<h:price>3.69</h:price>
<h:file>
<o:file xmlns:o="http://www.office.com/people">
<o:content>Employee data</o:content>
<o:numberOfPages>25</o:numberOfPages>
</o:file>
XML Namespaces
 How to distinguish?
 Solution : namespaces
<h:file xmlns:h="http://www.hardware.com/">
<h:length>18</h:length>
<h:price>3.69</h:price>
<h:file>
<o:file xmlns:o="http://www.office.com/people">
<o:content>Employee data</o:content>
<o:numberOfPages>25</o:numberOfPages>
</o:file>
XML Parsers
• A piece of software which reads the content from the XML documents and present it
to the application
• Implementing xml parser
• Java way
• SAX (Simple API for XML)
• DOM (Document Object Model)
• StAX (Streaming API for XML)
XML Parsers
XML Parser Demos
XML Parsers
Feature StAX SAX DOM
API Type Pull, Streaming Push, Streaming In memory tree
Ease of Use High Medium High
XPath Capability No No Yes
CPU and Memory
Efficiency
Good Good Varies
Forward Only Yes Yes No
Read XML Yes Yes Yes
Write XML Yes No Yes
CRUD No No Yes
XSL
• XSL is a language for expressing stylesheets
• eXtensible Stylesheet Language
• XSLT (XSL Transformations)
• XPath
• XML vocabulary for specifying formatting semantics
XPath
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price>39.95</price>
</book>
</bookstore>
/bookstore
XPath
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price>39.95</price>
</book>
</bookstore>
/bookstore/book
XPath
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price>39.95</price>
</book>
</bookstore>
//book
XPath
• Few Examples
 How to refer to the body element ?
 /note/body [ '/' means root ]
 How to get the source attribute ?
 /note/from/@source
 How to get all elements with a source attribute ?
 //*[@source]
XSLT
• A language to convert XML documents to other
formats
• w3c Recommendation
• Uses XPath

More Related Content

What's hot

The Document Object Model
The Document Object ModelThe Document Object Model
The Document Object ModelKhou Suylong
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelyht4ever
 
INTRODUCTION TO DOM AND DOM TREE
INTRODUCTION TO DOM AND DOM TREEINTRODUCTION TO DOM AND DOM TREE
INTRODUCTION TO DOM AND DOM TREEsystematiclab
 
Introduction to XML and Databases
Introduction to XML and DatabasesIntroduction to XML and Databases
Introduction to XML and Databasestorp42
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Ayes Chinmay
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQsUmar Ali
 
Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.eross77
 

What's hot (17)

The Document Object Model
The Document Object ModelThe Document Object Model
The Document Object Model
 
Xml
XmlXml
Xml
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Introduction to the DOM
Introduction to the DOMIntroduction to the DOM
Introduction to the DOM
 
INTRODUCTION TO DOM AND DOM TREE
INTRODUCTION TO DOM AND DOM TREEINTRODUCTION TO DOM AND DOM TREE
INTRODUCTION TO DOM AND DOM TREE
 
Introduction to DOM
Introduction to DOMIntroduction to DOM
Introduction to DOM
 
Hushang Gaikwad
Hushang GaikwadHushang Gaikwad
Hushang Gaikwad
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Dhtml
DhtmlDhtml
Dhtml
 
Introduction to XML and Databases
Introduction to XML and DatabasesIntroduction to XML and Databases
Introduction to XML and Databases
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS]
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
 
Mongo db
Mongo dbMongo db
Mongo db
 
Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.
 

Similar to Web Information Systems XML (20)

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)
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
Full xml
Full xmlFull xml
Full xml
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
Xml
XmlXml
Xml
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond
 
Xml
XmlXml
Xml
 
Xml nisha dwivedi
Xml nisha dwivediXml nisha dwivedi
Xml nisha dwivedi
 
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
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
IT6801-Service Oriented Architecture- UNIT-I notes
IT6801-Service Oriented Architecture- UNIT-I notesIT6801-Service Oriented Architecture- UNIT-I notes
IT6801-Service Oriented Architecture- UNIT-I notes
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
CrashCourse: XML technologies
CrashCourse: XML technologiesCrashCourse: XML technologies
CrashCourse: XML technologies
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Web Information Systems XML

  • 2. XML  eXtensible Markup Language  w3c standard  Why?  Store and transport data  Easy data exchange  Create more languages  WSDL (Web Service Description Language)  RDF (Resource Description Framework)  RSS (Really Simple Syndication)  Self-describing data  Easy to learn  Must learn
  • 3. 3 Major Components  XML  XSL (eXtensible Stylesheet Language)  Style sheet language for XML documents  XSD (XML Schema Definition)  Describes the structure of an XML document
  • 4. XML Document <?xml version="1.0"?> <!-- this is a sample --> <note> <to>Tove</to> <from source=”contacts”>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> Processing Instruction Comment Element Attribute
  • 5. XML Documents  Well formed and Valid  Well formed  Should only contain one root element  All tags should have corresponding end tag  Tags never overlap(<author><name> … </author></name>)  Attributes must be quoted  Valid  Must be well formed and conforms to the schema
  • 6. XML Documents  Has tree structure  Tags are case sensitive  <name> is different from <Name>  Comments <!-- this is a comment -->
  • 7. XML Elements  Can contain  Other elements  Text  Attributes  Valid names  <name>, <first_name>, <first2names>  Invalid names  <2nd_name>, <$amount>, <first name>
  • 8. XML elements and Attributes  Data goes as elements  <person><name>john</name></person>  Meta data goes as attributes  <image type='gif'><name>graph.gif</name></image>
  • 9. 1.0 vs 1.1 • 1.0 – everything not permitted is forbidden • 1.1 – everything not forbidden is permitted • 1.0 is compatible with 1.1, not vise-versa • Forward compatible • Does not affect to English documents
  • 10. XML Namespaces  There can be common elements in multiple domains  File in hardware and office <file> <length>18</length> <price>3.69</price> <file> <file> <content>Employee data</content> <numberOfPages>25</numberOfPages> </file>
  • 11. XML Namespaces  How to distinguish?  Solution : namespaces <h:file xmlns:h="http://www.hardware.com/"> <h:length>18</h:length> <h:price>3.69</h:price> <h:file> <o:file xmlns:o="http://www.office.com/people"> <o:content>Employee data</o:content> <o:numberOfPages>25</o:numberOfPages> </o:file>
  • 12. XML Namespaces  How to distinguish?  Solution : namespaces <h:file xmlns:h="http://www.hardware.com/"> <h:length>18</h:length> <h:price>3.69</h:price> <h:file> <o:file xmlns:o="http://www.office.com/people"> <o:content>Employee data</o:content> <o:numberOfPages>25</o:numberOfPages> </o:file>
  • 13. XML Parsers • A piece of software which reads the content from the XML documents and present it to the application • Implementing xml parser • Java way • SAX (Simple API for XML) • DOM (Document Object Model) • StAX (Streaming API for XML)
  • 15. XML Parsers Feature StAX SAX DOM API Type Pull, Streaming Push, Streaming In memory tree Ease of Use High Medium High XPath Capability No No Yes CPU and Memory Efficiency Good Good Varies Forward Only Yes Yes No Read XML Yes Yes Yes Write XML Yes No Yes CRUD No No Yes
  • 16. XSL • XSL is a language for expressing stylesheets • eXtensible Stylesheet Language • XSLT (XSL Transformations) • XPath • XML vocabulary for specifying formatting semantics
  • 17. XPath <?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title lang="en">Harry Potter</title> <price>29.99</price> </book> <book> <title lang="en">Learning XML</title> <price>39.95</price> </book> </bookstore> /bookstore
  • 18. XPath <?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title lang="en">Harry Potter</title> <price>29.99</price> </book> <book> <title lang="en">Learning XML</title> <price>39.95</price> </book> </bookstore> /bookstore/book
  • 19. XPath <?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title lang="en">Harry Potter</title> <price>29.99</price> </book> <book> <title lang="en">Learning XML</title> <price>39.95</price> </book> </bookstore> //book
  • 20. XPath • Few Examples  How to refer to the body element ?  /note/body [ '/' means root ]  How to get the source attribute ?  /note/from/@source  How to get all elements with a source attribute ?  //*[@source]
  • 21. XSLT • A language to convert XML documents to other formats • w3c Recommendation • Uses XPath