SlideShare uma empresa Scribd logo
1 de 27
 eXtensible Markup Language, is a
  specification for creating custom
  markup languages
 W3C Recommendation
 Primary purpose is to help computers to
  share data
 XML is meta-language. This means that
  you use it for creating languages.
 XML is an extensive concept.
 Every XML-document is text-based
 => sharing data between different
  computers!
 => sharing data in Internet!
 => platform independence!
   Problems with Binary format
    › Platform depence
    › Firewalls
    › Hard to debug
    › Inspecting the file can be hard
 Since XML is text-based, it does not have
  the problems mentioned above.
 What are the disadvantages in text
  format?
   XML is meta language, which you can use
    to create your own markup languages.
   There are several XML Markup Languages
    made for different purposes
   All the languages have common xml-rules
   Languages: XHTML, OOXML, Open
    Document, RSS, SVG, SOAP, SMIL, MathML...
   List:
    › http://en.wikipedia.org/wiki/List_of_XML_markup_languag
      es
<?xml version="1.0"?>
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>Minimal XHTML 1.0 Document</title>
 </head>
 <body>
  <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a>
  document.</p>
 </body>
</html>
<?xml version="1.0"?>
<!DOCTYPE svg
   PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>

</svg>
<?xml version="1.0"?>
<!DOCTYPE math:math PUBLIC "-//OpenOffice.org//DTD Modified W3C MathML
    1.01//EN" "math.dtd">
<math:math xmlns:math="http://www.w3.org/1998/Math/MathML">
<math:semantics>
 <math:mrow>
  <math:mi>x</math:mi>
  <math:mo math:stretchy="false">=</math:mo>
  <math:mfrac>
  <math:mrow>
     ...
  </math:mrow>
 <math:annotation math:encoding="StarMath 5.0">x = {-b +-sqrt{b^{2}-4{ac}} } over {2
    {a}} </math:annotation>
</math:semantics>
</math:math>
<?xml version="1.0"?>
<rss version="2.0">
<channel>
 <title>W3Schools Home Page</title>
 <link>http://www.w3schools.com</link>
 <description>Free web building tutorials</description>
 <item>
   <title>RSS Tutorial</title>
   <link>http://www.w3schools.com/rss</link>
   <description>New RSS tutorial on W3Schools</description>
 </item>
 <item>
   <title>XML Tutorial</title>
   <link>http://www.w3schools.com/xml</link>
   <description>New XML tutorial on W3Schools</description>
 </item>
</channel>
</rss>
 XML Spy
 EditiX
 Microsoft XML Notepad
 Visual XML
 XML Viewer
 Xeena
 XML Styler, Morphon, XML Writer…
Rules that Apply to Every
XML-Document
   There are two levels of correctness of an
    XML document:
    1. Well-formed. A well-formed document
       conforms to all of XML's syntax rules.
    2. Valid. A valid document additionally
       conforms to some semantic rules.
   Let's first look at the XML's syntax rules (1).
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<presentation>
  <slide number="1">
    <name>Introduction to XML</name>
    <contents>XML is ...</contents>
  </slide>
</presentation>
   XML-declaration is optional in XML 1.0,
    mandatory in 1.1.
    › Recommendation: use it.
   Version: 1.0 or 1.1
   Encoding: character encoding, default utf-8
   Standalone:
    › is the xml-document linked to external markup
      declaration
    › yes: no external markup declarations
    › no: can have external markup declaration (open
      issue..)
    › default: "no"
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<presentation>
  <slide>
    <name>Introduction to XML</name>
    <contents>XML is ...</contents>
  </slide>
</presentation>
                                       Same Declaration
<?xml version="1.0"?>
<presentation>
  <slide>
    <name>Introduction to XML</name>
    <contents>XML is ...</contents>
  </slide>
</presentation>
   Element consists of start tag, optional content
    and an end tag:
    › <name>Introduction to XML</name>
   Start tag
    › <name>
   Content
    › Introduction to XML
   End tag
    › </name>
   Start tag may have attribute
    › <slide number="1">
 Only one root - element
 Every element contains starting tag and an ending
  tag
 Content is optional: Empty element
   › <x></x> <!-- same as -->
   › <x/>
 Tag – names are case-sensitive:
   › <X></x> <!-- Error -->
 Elements must be ended with the end tag in
  correct order:
   › <p><i>problem here</p></i> <!– Error 
 XML   elements can have attributes
  in the start tag.
 Attributes must be quoted:
  › <person sex="female">
  › <person sex='female'>
  › <gangster name='George "Shotgun" Ziegler'>
  › <gangster name="George
   &quot;Shotgun&quot; Ziegler">
 Names can contain letters, numbers,
  and other characters
 Names must not start with a number or
  punctuation character
 Names must not start with the letters xml
  (or XML, or Xml, etc)
 Names cannot contain spaces
 XML document is well-formed if it follows
  the syntax rules.
 XML document must be well-formed!
    › it's not an xml-document, if it does not follow
     the rules..
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>Minimal XHTML 1.0 Document</title>
 </head>
 <body>
  <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a>
  document.</p>
 </body>
</html>
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>Minimal XHTML 1.0 Document</title>
 </head>
 <body>
  <jorma>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a>
  document.</jorma>
 </body>
</html>
Defining the Structure for XML
documents
   XML document is valid if
    › 1) It is well formed AND
    › 2) It follows some semantic rules
   XML document is usually linked to an
    external file, that has semantic rules for the
    document.
    › The file can be dtd (.dtd) or schema (.xsd)
   Semantic rules?
    › Name of tags, order of elements
 Because of HTML heritage, browsers try
  to understand invalid XHTML-pages
 This is not the case in other XML-
  languages.
 In general, if XML-document is
  invalid, the processing of the document
  is cancelled.
 XML has strict rules for WF and Valid
 If application tries to manipulate xml-
  document it does not have to try to
  understand the possible errors in the
  document
 This means that handling xml-files via
  programming language is much easier
    › If the document is correctly formed,
      manipulate it
    › If it isn't display error
   For More Like Our Pages:
   https://www.facebook.com/allgtubooks
   https://www.facebook.com/gtumaterials
   https://www.facebook.com/GTU.Projects.Jobs

Mais conteúdo relacionado

Mais procurados

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
apnwebdev
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
Sudharsan S
 

Mais procurados (20)

Xml
XmlXml
Xml
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Xml
XmlXml
Xml
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
CSS
CSSCSS
CSS
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohan
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
HTML
HTMLHTML
HTML
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
PHP
PHPPHP
PHP
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
php
phpphp
php
 

Semelhante a Introduction to xml

XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
Sudharsan S
 

Semelhante a Introduction to xml (20)

Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Processing XML
Processing XMLProcessing XML
Processing XML
 
Xml
XmlXml
Xml
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)
 
Xml andweb services
Xml andweb services Xml andweb services
Xml andweb services
 
WEB PROGRAMMING
WEB PROGRAMMINGWEB PROGRAMMING
WEB PROGRAMMING
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
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
 
23xml
23xml23xml
23xml
 
XHTML
XHTMLXHTML
XHTML
 
CrashCourse: XML technologies
CrashCourse: XML technologiesCrashCourse: XML technologies
CrashCourse: XML technologies
 
Dos and donts
Dos and dontsDos and donts
Dos and donts
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Introduction to xml

  • 1.
  • 2.  eXtensible Markup Language, is a specification for creating custom markup languages  W3C Recommendation  Primary purpose is to help computers to share data  XML is meta-language. This means that you use it for creating languages.  XML is an extensive concept.
  • 3.  Every XML-document is text-based  => sharing data between different computers!  => sharing data in Internet!  => platform independence!
  • 4. Problems with Binary format › Platform depence › Firewalls › Hard to debug › Inspecting the file can be hard  Since XML is text-based, it does not have the problems mentioned above.  What are the disadvantages in text format?
  • 5. XML is meta language, which you can use to create your own markup languages.  There are several XML Markup Languages made for different purposes  All the languages have common xml-rules  Languages: XHTML, OOXML, Open Document, RSS, SVG, SOAP, SMIL, MathML...  List: › http://en.wikipedia.org/wiki/List_of_XML_markup_languag es
  • 6. <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</p> </body> </html>
  • 7. <?xml version="1.0"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/> </svg>
  • 8. <?xml version="1.0"?> <!DOCTYPE math:math PUBLIC "-//OpenOffice.org//DTD Modified W3C MathML 1.01//EN" "math.dtd"> <math:math xmlns:math="http://www.w3.org/1998/Math/MathML"> <math:semantics> <math:mrow> <math:mi>x</math:mi> <math:mo math:stretchy="false">=</math:mo> <math:mfrac> <math:mrow> ... </math:mrow> <math:annotation math:encoding="StarMath 5.0">x = {-b +-sqrt{b^{2}-4{ac}} } over {2 {a}} </math:annotation> </math:semantics> </math:math>
  • 9. <?xml version="1.0"?> <rss version="2.0"> <channel> <title>W3Schools Home Page</title> <link>http://www.w3schools.com</link> <description>Free web building tutorials</description> <item> <title>RSS Tutorial</title> <link>http://www.w3schools.com/rss</link> <description>New RSS tutorial on W3Schools</description> </item> <item> <title>XML Tutorial</title> <link>http://www.w3schools.com/xml</link> <description>New XML tutorial on W3Schools</description> </item> </channel> </rss>
  • 10.  XML Spy  EditiX  Microsoft XML Notepad  Visual XML  XML Viewer  Xeena  XML Styler, Morphon, XML Writer…
  • 11. Rules that Apply to Every XML-Document
  • 12. There are two levels of correctness of an XML document: 1. Well-formed. A well-formed document conforms to all of XML's syntax rules. 2. Valid. A valid document additionally conforms to some semantic rules.  Let's first look at the XML's syntax rules (1).
  • 13. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <presentation> <slide number="1"> <name>Introduction to XML</name> <contents>XML is ...</contents> </slide> </presentation>
  • 14. XML-declaration is optional in XML 1.0, mandatory in 1.1. › Recommendation: use it.  Version: 1.0 or 1.1  Encoding: character encoding, default utf-8  Standalone: › is the xml-document linked to external markup declaration › yes: no external markup declarations › no: can have external markup declaration (open issue..) › default: "no"
  • 15. <?xml version="1.0" encoding="utf-8" standalone="no"?> <presentation> <slide> <name>Introduction to XML</name> <contents>XML is ...</contents> </slide> </presentation> Same Declaration <?xml version="1.0"?> <presentation> <slide> <name>Introduction to XML</name> <contents>XML is ...</contents> </slide> </presentation>
  • 16. Element consists of start tag, optional content and an end tag: › <name>Introduction to XML</name>  Start tag › <name>  Content › Introduction to XML  End tag › </name>  Start tag may have attribute › <slide number="1">
  • 17.  Only one root - element  Every element contains starting tag and an ending tag  Content is optional: Empty element › <x></x> <!-- same as --> › <x/>  Tag – names are case-sensitive: › <X></x> <!-- Error -->  Elements must be ended with the end tag in correct order: › <p><i>problem here</p></i> <!– Error 
  • 18.  XML elements can have attributes in the start tag.  Attributes must be quoted: › <person sex="female"> › <person sex='female'> › <gangster name='George "Shotgun" Ziegler'> › <gangster name="George &quot;Shotgun&quot; Ziegler">
  • 19.  Names can contain letters, numbers, and other characters  Names must not start with a number or punctuation character  Names must not start with the letters xml (or XML, or Xml, etc)  Names cannot contain spaces
  • 20.  XML document is well-formed if it follows the syntax rules.  XML document must be well-formed! › it's not an xml-document, if it does not follow the rules..
  • 21. <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</p> </body> </html>
  • 22. <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <jorma>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</jorma> </body> </html>
  • 23. Defining the Structure for XML documents
  • 24. XML document is valid if › 1) It is well formed AND › 2) It follows some semantic rules  XML document is usually linked to an external file, that has semantic rules for the document. › The file can be dtd (.dtd) or schema (.xsd)  Semantic rules? › Name of tags, order of elements
  • 25.  Because of HTML heritage, browsers try to understand invalid XHTML-pages  This is not the case in other XML- languages.  In general, if XML-document is invalid, the processing of the document is cancelled.
  • 26.  XML has strict rules for WF and Valid  If application tries to manipulate xml- document it does not have to try to understand the possible errors in the document  This means that handling xml-files via programming language is much easier › If the document is correctly formed, manipulate it › If it isn't display error
  • 27. For More Like Our Pages:  https://www.facebook.com/allgtubooks  https://www.facebook.com/gtumaterials  https://www.facebook.com/GTU.Projects.Jobs