SlideShare a Scribd company logo
1 of 37
INTRODUCTION TO XML 
EXTENSIBLE MARKUP 
LANGUAGE
What is XML 
 XML stands for eXtensible Markup Language. 
 A markup language is used to provide 
information about a document. 
 Tags are added to the document to provide the 
extra information. 
 HTML tags tell a browser how to display the 
document. 
 XML tags give a reader some idea what some of 
the data means.
What is XML? 
 a meta language that allows you to create and 
format your own document markups 
 a method for putting structured data into a text 
file; these files are 
- easy to read 
- unambiguous 
- extensible 
- platform-independent 
 XML documents are used to transfer data from 
one place to another often over the Internet.
Difference Between HTML and XML 
 HTML tags have a fixed meaning and 
browsers know what it is. 
 XML tags are different for different 
applications, and users know what they mean. 
 HTML tags are used for display. 
 XML tags are used to describe documents and 
data.
Quick Comparison 
 HTML 
- tags and attributes are pre-determined 
and rigid 
- content and formatting can 
be placed together 
<p><font=”Arial”>text</font 
> 
- Designed to represent the 
presentation structure of a 
document. Thus, more 
effective for machine-human 
interaction 
- Loose syntax compared to 
 XML 
- allows user to specify what 
each tag and attribute 
means 
- content and format are 
separate; formatting is 
contained in a stylesheet 
- Designed to represent the 
logical structure of a 
document. Thus, more 
effective for machine-machine 
interaction 
- Syntax is strictly defined
Advantages of XML 
 XML is text (Unicode) based. 
 Takes up less space. 
 Can be transmitted efficiently. 
 One XML document can be displayed differently 
in different media. 
 Html, video, CD, DVD, 
 You only have to change the XML document in order 
to change all the rest. 
 XML documents can be modularized. Parts can 
be reused.
Possible Advantages of Using XML 
 Truly Portable Data 
 Easily readable by human users 
 Very expressive (semantics near data) 
 Very flexible and customizable (no finite tag 
set) 
 Easy to use from programs (libs available) 
 Easy to convert into other representations 
(XML transformation languages) 
 Many additional standards and tools 
 Widely used and supported
Example of an HTML Document 
<html> 
<head><title>Example</title></head. 
<body> 
<h1>This is an example of a page.</h1> 
<h2>Some information goes here.</h2> 
</body> 
</html>
Example of an XML Document 
<?xml version=“1.0”/> 
<address> 
<name>Alice Lee</name> 
<email>alee@aol.com</email> 
<phone>212-346-1234</phone> 
<birthday>1995-03-22</birthday> 
</address> 
The actual benefit of using XML highly depends 
on the design of the application.
App. Scenario 1: Content Mgt. 
Clients 
XML2HTML XML2WML XML2PDF Converters 
Database with 
XML documents
App. Scenario 2: Data Exchange 
Buyer Supplier 
Legacy 
System 
(e.g., SAP 
R/2) 
Legacy 
System 
(e.g., 
Cobol) 
XML 
Adapter 
XML 
Adapter 
XML 
(BMECat, ebXML, RosettaNet, BizTalk, …) 
Order
App. Scenario 3: XML for Metadata 
<rdf:RDF 
<rdf:Description rdf:about="http://www-dbs/Sch03.pdf"> 
<dc:title>A Framework for…</dc:title> 
<dc:creator>Ralf Schenkel</dc:creator> 
<dc:description>While there are...</dc:description> 
<dc:publisher>Saarland University</dc:publisher> 
<dc:subject>XML Indexing</dc:subject> 
<dc:rights>Copyright ...</dc:rights> 
<dc:type>Electronic Document</dc:type> 
<dc:format>text/pdf</dc:format> 
<dc:language>en</dc:language> 
</rdf:Description> 
</rdf:RDF>
App. Scenario 4: Document Markup 
<article> 
<section id=„1“ title=„Intro“> 
This article is about <index>XML</index>. 
</section> 
<section id=„2“ title=„Main Results“> 
<name>Weikum</name> <cite idref=„Weik01“/> shows 
the following theorem (see Section <ref idref=„1“/>) 
<theorem id=„theo:1“ source=„Weik01“> 
For any XML document x, ... 
</theorem> 
</section> 
<literature> 
<cite id=„Weik01“><author>Weikum</author></cite> 
</literature> 
</article>
App. Scenario 4: Document Markup 
• Document Markup adds structural and semantic 
information to documents, e.g. 
– Sections, Subsections, Theorems, … 
– Cross References 
– Literature Citations 
– Index Entries 
– Named Entities 
• This allows queries like 
– Which articles cite Weikum‘s XML paper from 2001? 
– Which articles talk about (the named entity) „Weikum“?
XML Documents 
What‘s in an XML document? 
• Elements 
• Attributes 
• plus some other details
A Simple XML Document 
<article> 
<author>Gerhard Weikum</author> 
<title>The Web in Ten Years</title> 
<text> 
<abstract>In order to evolve...</abstract> 
<section number=“1” title=“Introduction”> 
The <index>Web</index> provides the universal... 
</section> 
</text> 
</article>
A Simple XML Document 
<article> 
<author>Gerhard Weikum</author> 
<title>The Web in Ten Years</title> 
<text> 
<abstract>In order to evolve...</abstract> 
<section number=“1” title=“Introduction”> 
The <index>Web</index> provides the universal... 
</section> 
</text> 
</article> 
Freely definable tags
A Simple XML Document 
Element 
Content of 
the Element 
(Subelements 
and/or Text) 
<article> 
<author>Gerhard Weikum</author> 
<title>The Web in Ten Years</title> 
<text> 
<abstract>In order to evolve...</abstract> 
<section number=“1” title=“Introduction”> 
The <index>Web</index> provides the universal... 
</section> 
</text> 
</article> 
End Tag 
Start Tag
A Simple XML Document 
<article> 
<author>Gerhard Weikum</author> 
<title>The Web in Ten Years</title> 
<text> 
<abstract>In order to evolve...</abstract> 
<section number=“1” title=“Introduction”> 
The <index>Web</index> provides the universal... 
</section> 
</text> 
</article> 
Attributes with 
name and value
Elements in XML Documents 
• (Freely definable) tags: article, title, author 
– with start tag: <article> etc. 
– and end tag: </article> etc. 
• Elements: <article> ... </article> 
• Elements have a name (article) and a content (...) 
• Elements may be nested. 
• Elements may be empty: <this_is_empty/> 
• Element content is typically parsed character data (PCDATA), 
i.e., strings with special characters, and/or nested elements (mixed 
content if both). 
• Each XML document has exactly one root element and forms a 
tree. 
• Elements with a common parent are ordered.
Elements vs. Attributes 
Elements may have attributes (in the start tag) that have a name 
and 
a value, e.g. <section number=“1“>. 
What is the difference between elements and attributes? 
• Only one attribute with a given name per element (but an 
arbitrary number of subelements) 
• Attributes have no structure, simply strings (while elements can 
have subelements) 
As a rule of thumb: 
• Content into elements 
• Metadata into attributes 
Example: 
<person born=“1912-06-23“ died=“1954-06-07“> 
Alan Turing</person> proved that…
XML Documents as Ordered Trees 
article 
author title text 
abstract section 
The index 
Web 
number=“1“ 
title=“…“ 
provides … 
In order … 
Gerhard 
Weikum 
The Web 
in 10 years
Well-Formed XML Documents 
A well-formed document must adher to, among others, the 
following rules: 
• Every start tag has a matching end tag. 
• Elements may nest, but must not overlap. 
• There must be exactly one root element. 
• Attribute values must be quoted. 
• An element may not have two attributes with the same 
name. 
• Comments and processing instructions may not appear 
inside tags. 
• No unescaped < or & signs may occur inside character 
data.
Well-Formed XML Documents 
A well-formed document must adher to, among others, the 
following rules: 
• Every start tag has a matching end tag. 
• Elements may nest, but must not overlap. 
• There Only must be well-exactly formed one root element. 
documents 
• Attribute values must be quoted. 
• An element can may be not processed have to attributes by XML 
with the same 
name. 
parsers. 
• Comments and processing instructions may not appear 
inside tags. 
• No unescaped < or & signs may occur inside character 
data.
Document Type Definitions 
Sometimes XML is too flexible: 
• Most Programs can only process a subset of all possible 
XML applications 
• For exchanging data, the format (i.e., elements, 
attributes and their semantics) must be fixed 
ÞDocument Type Definitions (DTD) for establishing the 
vocabulary for one XML application (in some sense 
comparable to schemas in databases) 
A document is valid with respect to a DTD if it conforms 
to the rules specified in that DTD. 
Most XML parsers can be configured to validate.
DTD Example: Elements 
<!ELEMENT article (title,author+,text)> 
<!ELEMENT title (#PCDATA)> 
<!ELEMENT author (#PCDATA)> 
<!ELEMENT text (abstract,section*,literature?)> 
<!ELEMENT abstract (#PCDATA)> 
<!ELEMENT section (#PCDATA|index)+> 
<!ELEMENT literature (#PCDATA)> 
<!ELEMENT index (#PCDATA)> 
Content of the title element 
is parsed character data 
Content of the article element is a title element, 
followed by one or more author elements, 
followed by a text element 
Content of the text element may 
contain zero or more section 
elements in this position
Element Declarations in DTDs 
One element declaration for each element type: 
<!ELEMENT element_name content_specification> 
where content_specification can be 
• (#PCDATA) parsed character data 
• (child) one child element 
• (c1,…,cn) a sequence of child elements c1…cn 
• (c1|…|cn) one of the elements c1…cn
Attribute Declarations in DTDs 
Attributes are declared per element: 
<!ATTLIST section number CDATA #REQUIRED 
title CDATA #REQUIRED> 
declares two required attributes for element section. 
element name 
attribute name 
attribute type 
attribute default
Attribute Declarations in DTDs 
Attributes are declared per element: 
<!ATTLIST section number CDATA #REQUIRED 
title CDATA #REQUIRED> 
declares two required attributes for element section. 
Possible attribute defaults: 
• #REQUIRED is required in each element instance 
• #IMPLIED is optional 
• #FIXED default always has this default value 
• default has this default value if the attribute is 
omitted from the element instance
Attribute Types in DTDs 
• CDATA string data 
• (A1|…|An) enumeration of all possible values of the 
attribute (each is XML name) 
• ID unique XML name to identify the element 
• IDREF refers to ID attribute of some other element 
(„intra-document link“) 
• IDREFS list of IDREF, separated by white space 
• plus some more
Attribute Examples 
<ATTLIST publication type (journal|inproceedings) #REQUIRED 
pubid ID #REQUIRED> 
<ATTLIST cite cid IDREF #REQUIRED> 
<ATTLIST citation ref IDREF #IMPLIED 
cid ID #REQUIRED> 
<publications> 
<publication type=“journal“ pubid=“Weikum01“> 
<author>Gerhard Weikum</author> 
<text>In the Web of 2010, XML <cite cid=„12“/>...</text> 
<citation cid=„12“ ref=„XML98“/> 
<citation cid=„15“>...</citation> 
</publication> 
<publication type=“inproceedings“ pubid=“XML98“> 
<text>XML, the extended Markup Language, ...</text> 
</publication> 
</publications>
Attribute Examples 
<ATTLIST publication type (journal|inproceedings) #REQUIRED 
pubid ID #REQUIRED> 
<ATTLIST cite cid IDREF #REQUIRED> 
<ATTLIST citation ref IDREF #IMPLIED 
cid ID #REQUIRED> 
<publications> 
<publication type=“journal“ pubid=“Weikum01“> 
<author>Gerhard Weikum</author> 
<text>In the Web of 2010, XML <cite cid=„12“/>...</text> 
<citation cid=„12“ ref=„XML98“/> 
<citation cid=„15“>...</citation> 
</publication> 
<publication type=“inproceedings“ pubid=“XML98“> 
<text>XML, the extended Markup Language, ...</text> 
</publication> 
</publications>
Linking DTD and XML Docs 
• Document Type Declaration in the XML document: 
<!DOCTYPE article SYSTEM “http://www-dbs/article.dtd“> 
keywords Root element URI for the DTD
Linking DTD and XML Docs 
• Internal DTD: 
<?xml version=“1.0“?> 
<!DOCTYPE article [ 
<!ELEMENT article (title,author+,text)> 
... 
<!ELEMENT index (#PCDATA)> 
]> 
<article> 
... 
</article>
Flaws of DTDs 
• No support for basic data types like integers, doubles, 
dates, times, … 
• No structured, self-definable data types 
• No type derivation 
• id/idref links are quite loose (target is not specified) 
Þ XML Schema
Displaying XML Documents 
• Different approaches- 
– Extensible Style Language (XSL) 
– Document Style & Semantics Language (DSSL) 
– Cascading Style Sheets (CSS) 
CSS were originally designed for displaying HTML but XML browser can 
also use this. 
Unlike CSS, which utilizes the formatting and style instructions to directly 
display the XML document, XSL normally first transforms he XML 
document into a suitable format for display, such as HTML or RTF (Rich 
Text Format). 
It the sends this to an XSL processor(such as a browser or application), which 
then generates the required HTML or RTF output. 
Thus XSL style sheet has 2 parts:- Transforming, and Formatting.
Applications of XML 
• Database applications 
• Document Mark-up( with HTML) 
• Mathematical Mark-up language(MATHML) 
• Messaging b/w different business platforms 
• Channel definition Format (CDF) 
• Metacontent definition 
• Platform for Internet Context Selection (PICS) 
• Platform for Privacy References Syntax Specification 
(P3P) 
• Resource Description Format (RDF) 
• Scaleable Vector Graphics (SVG) 
• Synchronized Multemedia Integration Language (SMIL)

More Related Content

What's hot (20)

XML
XMLXML
XML
 
Sgml
SgmlSgml
Sgml
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Js ppt
Js pptJs ppt
Js ppt
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Web technology
Web technologyWeb technology
Web technology
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Threads And Synchronization in C#
Threads And Synchronization in C#Threads And Synchronization in C#
Threads And Synchronization in C#
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Javascript
JavascriptJavascript
Javascript
 
Html ppt
Html pptHtml ppt
Html ppt
 
Xml schema
Xml schemaXml schema
Xml schema
 
Html
HtmlHtml
Html
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 

Viewers also liked

Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xmlGtu Booker
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecturenupurmakhija1211
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 

Viewers also liked (6)

Corba
CorbaCorba
Corba
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
Corba
CorbaCorba
Corba
 
C O R B A Unit 4
C O R B A    Unit 4C O R B A    Unit 4
C O R B A Unit 4
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 

Similar to Xml (20)

XML.pptx
XML.pptxXML.pptx
XML.pptx
 
Xml Lecture Notes
Xml Lecture NotesXml Lecture Notes
Xml Lecture Notes
 
Xml 1
Xml 1Xml 1
Xml 1
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
 
Xml
XmlXml
Xml
 
XML for beginners
XML for beginnersXML for beginners
XML for beginners
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptx
 
XML
XMLXML
XML
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
Decoding and developing the online finding aid
Decoding and developing the online finding aidDecoding and developing the online finding aid
Decoding and developing the online finding aid
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
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
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1
 
Xml
XmlXml
Xml
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Full xml
Full xmlFull xml
Full xml
 

Recently uploaded

8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 

Recently uploaded (20)

8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 

Xml

  • 1. INTRODUCTION TO XML EXTENSIBLE MARKUP LANGUAGE
  • 2. What is XML  XML stands for eXtensible Markup Language.  A markup language is used to provide information about a document.  Tags are added to the document to provide the extra information.  HTML tags tell a browser how to display the document.  XML tags give a reader some idea what some of the data means.
  • 3. What is XML?  a meta language that allows you to create and format your own document markups  a method for putting structured data into a text file; these files are - easy to read - unambiguous - extensible - platform-independent  XML documents are used to transfer data from one place to another often over the Internet.
  • 4. Difference Between HTML and XML  HTML tags have a fixed meaning and browsers know what it is.  XML tags are different for different applications, and users know what they mean.  HTML tags are used for display.  XML tags are used to describe documents and data.
  • 5. Quick Comparison  HTML - tags and attributes are pre-determined and rigid - content and formatting can be placed together <p><font=”Arial”>text</font > - Designed to represent the presentation structure of a document. Thus, more effective for machine-human interaction - Loose syntax compared to  XML - allows user to specify what each tag and attribute means - content and format are separate; formatting is contained in a stylesheet - Designed to represent the logical structure of a document. Thus, more effective for machine-machine interaction - Syntax is strictly defined
  • 6. Advantages of XML  XML is text (Unicode) based.  Takes up less space.  Can be transmitted efficiently.  One XML document can be displayed differently in different media.  Html, video, CD, DVD,  You only have to change the XML document in order to change all the rest.  XML documents can be modularized. Parts can be reused.
  • 7. Possible Advantages of Using XML  Truly Portable Data  Easily readable by human users  Very expressive (semantics near data)  Very flexible and customizable (no finite tag set)  Easy to use from programs (libs available)  Easy to convert into other representations (XML transformation languages)  Many additional standards and tools  Widely used and supported
  • 8. Example of an HTML Document <html> <head><title>Example</title></head. <body> <h1>This is an example of a page.</h1> <h2>Some information goes here.</h2> </body> </html>
  • 9. Example of an XML Document <?xml version=“1.0”/> <address> <name>Alice Lee</name> <email>alee@aol.com</email> <phone>212-346-1234</phone> <birthday>1995-03-22</birthday> </address> The actual benefit of using XML highly depends on the design of the application.
  • 10. App. Scenario 1: Content Mgt. Clients XML2HTML XML2WML XML2PDF Converters Database with XML documents
  • 11. App. Scenario 2: Data Exchange Buyer Supplier Legacy System (e.g., SAP R/2) Legacy System (e.g., Cobol) XML Adapter XML Adapter XML (BMECat, ebXML, RosettaNet, BizTalk, …) Order
  • 12. App. Scenario 3: XML for Metadata <rdf:RDF <rdf:Description rdf:about="http://www-dbs/Sch03.pdf"> <dc:title>A Framework for…</dc:title> <dc:creator>Ralf Schenkel</dc:creator> <dc:description>While there are...</dc:description> <dc:publisher>Saarland University</dc:publisher> <dc:subject>XML Indexing</dc:subject> <dc:rights>Copyright ...</dc:rights> <dc:type>Electronic Document</dc:type> <dc:format>text/pdf</dc:format> <dc:language>en</dc:language> </rdf:Description> </rdf:RDF>
  • 13. App. Scenario 4: Document Markup <article> <section id=„1“ title=„Intro“> This article is about <index>XML</index>. </section> <section id=„2“ title=„Main Results“> <name>Weikum</name> <cite idref=„Weik01“/> shows the following theorem (see Section <ref idref=„1“/>) <theorem id=„theo:1“ source=„Weik01“> For any XML document x, ... </theorem> </section> <literature> <cite id=„Weik01“><author>Weikum</author></cite> </literature> </article>
  • 14. App. Scenario 4: Document Markup • Document Markup adds structural and semantic information to documents, e.g. – Sections, Subsections, Theorems, … – Cross References – Literature Citations – Index Entries – Named Entities • This allows queries like – Which articles cite Weikum‘s XML paper from 2001? – Which articles talk about (the named entity) „Weikum“?
  • 15. XML Documents What‘s in an XML document? • Elements • Attributes • plus some other details
  • 16. A Simple XML Document <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article>
  • 17. A Simple XML Document <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article> Freely definable tags
  • 18. A Simple XML Document Element Content of the Element (Subelements and/or Text) <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article> End Tag Start Tag
  • 19. A Simple XML Document <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article> Attributes with name and value
  • 20. Elements in XML Documents • (Freely definable) tags: article, title, author – with start tag: <article> etc. – and end tag: </article> etc. • Elements: <article> ... </article> • Elements have a name (article) and a content (...) • Elements may be nested. • Elements may be empty: <this_is_empty/> • Element content is typically parsed character data (PCDATA), i.e., strings with special characters, and/or nested elements (mixed content if both). • Each XML document has exactly one root element and forms a tree. • Elements with a common parent are ordered.
  • 21. Elements vs. Attributes Elements may have attributes (in the start tag) that have a name and a value, e.g. <section number=“1“>. What is the difference between elements and attributes? • Only one attribute with a given name per element (but an arbitrary number of subelements) • Attributes have no structure, simply strings (while elements can have subelements) As a rule of thumb: • Content into elements • Metadata into attributes Example: <person born=“1912-06-23“ died=“1954-06-07“> Alan Turing</person> proved that…
  • 22. XML Documents as Ordered Trees article author title text abstract section The index Web number=“1“ title=“…“ provides … In order … Gerhard Weikum The Web in 10 years
  • 23. Well-Formed XML Documents A well-formed document must adher to, among others, the following rules: • Every start tag has a matching end tag. • Elements may nest, but must not overlap. • There must be exactly one root element. • Attribute values must be quoted. • An element may not have two attributes with the same name. • Comments and processing instructions may not appear inside tags. • No unescaped < or & signs may occur inside character data.
  • 24. Well-Formed XML Documents A well-formed document must adher to, among others, the following rules: • Every start tag has a matching end tag. • Elements may nest, but must not overlap. • There Only must be well-exactly formed one root element. documents • Attribute values must be quoted. • An element can may be not processed have to attributes by XML with the same name. parsers. • Comments and processing instructions may not appear inside tags. • No unescaped < or & signs may occur inside character data.
  • 25. Document Type Definitions Sometimes XML is too flexible: • Most Programs can only process a subset of all possible XML applications • For exchanging data, the format (i.e., elements, attributes and their semantics) must be fixed ÞDocument Type Definitions (DTD) for establishing the vocabulary for one XML application (in some sense comparable to schemas in databases) A document is valid with respect to a DTD if it conforms to the rules specified in that DTD. Most XML parsers can be configured to validate.
  • 26. DTD Example: Elements <!ELEMENT article (title,author+,text)> <!ELEMENT title (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT text (abstract,section*,literature?)> <!ELEMENT abstract (#PCDATA)> <!ELEMENT section (#PCDATA|index)+> <!ELEMENT literature (#PCDATA)> <!ELEMENT index (#PCDATA)> Content of the title element is parsed character data Content of the article element is a title element, followed by one or more author elements, followed by a text element Content of the text element may contain zero or more section elements in this position
  • 27. Element Declarations in DTDs One element declaration for each element type: <!ELEMENT element_name content_specification> where content_specification can be • (#PCDATA) parsed character data • (child) one child element • (c1,…,cn) a sequence of child elements c1…cn • (c1|…|cn) one of the elements c1…cn
  • 28. Attribute Declarations in DTDs Attributes are declared per element: <!ATTLIST section number CDATA #REQUIRED title CDATA #REQUIRED> declares two required attributes for element section. element name attribute name attribute type attribute default
  • 29. Attribute Declarations in DTDs Attributes are declared per element: <!ATTLIST section number CDATA #REQUIRED title CDATA #REQUIRED> declares two required attributes for element section. Possible attribute defaults: • #REQUIRED is required in each element instance • #IMPLIED is optional • #FIXED default always has this default value • default has this default value if the attribute is omitted from the element instance
  • 30. Attribute Types in DTDs • CDATA string data • (A1|…|An) enumeration of all possible values of the attribute (each is XML name) • ID unique XML name to identify the element • IDREF refers to ID attribute of some other element („intra-document link“) • IDREFS list of IDREF, separated by white space • plus some more
  • 31. Attribute Examples <ATTLIST publication type (journal|inproceedings) #REQUIRED pubid ID #REQUIRED> <ATTLIST cite cid IDREF #REQUIRED> <ATTLIST citation ref IDREF #IMPLIED cid ID #REQUIRED> <publications> <publication type=“journal“ pubid=“Weikum01“> <author>Gerhard Weikum</author> <text>In the Web of 2010, XML <cite cid=„12“/>...</text> <citation cid=„12“ ref=„XML98“/> <citation cid=„15“>...</citation> </publication> <publication type=“inproceedings“ pubid=“XML98“> <text>XML, the extended Markup Language, ...</text> </publication> </publications>
  • 32. Attribute Examples <ATTLIST publication type (journal|inproceedings) #REQUIRED pubid ID #REQUIRED> <ATTLIST cite cid IDREF #REQUIRED> <ATTLIST citation ref IDREF #IMPLIED cid ID #REQUIRED> <publications> <publication type=“journal“ pubid=“Weikum01“> <author>Gerhard Weikum</author> <text>In the Web of 2010, XML <cite cid=„12“/>...</text> <citation cid=„12“ ref=„XML98“/> <citation cid=„15“>...</citation> </publication> <publication type=“inproceedings“ pubid=“XML98“> <text>XML, the extended Markup Language, ...</text> </publication> </publications>
  • 33. Linking DTD and XML Docs • Document Type Declaration in the XML document: <!DOCTYPE article SYSTEM “http://www-dbs/article.dtd“> keywords Root element URI for the DTD
  • 34. Linking DTD and XML Docs • Internal DTD: <?xml version=“1.0“?> <!DOCTYPE article [ <!ELEMENT article (title,author+,text)> ... <!ELEMENT index (#PCDATA)> ]> <article> ... </article>
  • 35. Flaws of DTDs • No support for basic data types like integers, doubles, dates, times, … • No structured, self-definable data types • No type derivation • id/idref links are quite loose (target is not specified) Þ XML Schema
  • 36. Displaying XML Documents • Different approaches- – Extensible Style Language (XSL) – Document Style & Semantics Language (DSSL) – Cascading Style Sheets (CSS) CSS were originally designed for displaying HTML but XML browser can also use this. Unlike CSS, which utilizes the formatting and style instructions to directly display the XML document, XSL normally first transforms he XML document into a suitable format for display, such as HTML or RTF (Rich Text Format). It the sends this to an XSL processor(such as a browser or application), which then generates the required HTML or RTF output. Thus XSL style sheet has 2 parts:- Transforming, and Formatting.
  • 37. Applications of XML • Database applications • Document Mark-up( with HTML) • Mathematical Mark-up language(MATHML) • Messaging b/w different business platforms • Channel definition Format (CDF) • Metacontent definition • Platform for Internet Context Selection (PICS) • Platform for Privacy References Syntax Specification (P3P) • Resource Description Format (RDF) • Scaleable Vector Graphics (SVG) • Synchronized Multemedia Integration Language (SMIL)