What is XML - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

What is XML

Description:

Well-Formed XML. Tags must be nested properly. All start tags must have end tags ... Well-formed. valid. Document Type Definition * !DOCTYPE rootElementName ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 19
Provided by: lloydm6
Category:
Tags: xml | wellformed

less

Transcript and Presenter's Notes

Title: What is XML


1
What is XML?
  • eXtensible Markup Language
  • A subset of SGML (Standard Generalized Markup
    Language)
  • Mechanism to identify structures in a document
  • Markup language for documents containing
    structured information
  • Self-Descriptive
  • Buzz Word

2
XML and HTML
  • Similar in nature
  • lttagsgt
  • Labels
  • Elements
  • lttagsgt plus content
  • Reference Specification
  • WWW consortium (W3C)
  • HTML transitional
  • XHTML
  • XML 1.0

3
XML Document Structure
  • Declaration
  • Elements
  • Attributes
  • Character Data
  • Processing Instructions
  • Comments
  • Entity References

4
Declaration
  • ltxml version1.0 encodingiso-8859-1gt
  • Start of the file
  • Optional
  • Future proof

5
Elements
  • ltReportgt
  • XML Report
  • lt/Reportgt
  • Highest level termed as the root element
  • Contains
  • Start tag
  • Some Content
  • End tag

6
Attributes
  • ltReport AuthorSteviegt
  • XML Report
  • lt/Reportgt
  • Contains
  • Name
  • Value

7
Character Data
  • ltReport AuthorSteviegt
  • lttypegtXML lt/typegt Report
  • lt/Reportgt
  • Element Content
  • Special Symbols
  • and lt
  • See Entity References

8
Comments
  • lt!-- This is a Comment --gt

9
Entity References
10
Processing Instructions
  • lt?, and end with the string ?gt
  • Show a processing instruction at the appropriate
    place in the node tree (DOM)
  • Firing a processing instruction event (SAX)

11
Well-Formed XML
  • Tags must be nested properly
  • All start tags must have end tags
  • Use quotation marks properly for tag attributes
  • Use entity references

12
Document Type Definition
  • Set of rules
  • May be included in the document itself
  • May be linked externally
  • Confirming to a DTD
  • Well-formed
  • valid

13
Document Type Definition
  • lt!DOCTYPE rootElementName
  • insert declarations here
  • gt
  • lt!Element element (sub1, sub2,,subn)gt
  • lt!ATTLIST element name (value1value2)

14
XML Parsing
  • Document Object Model (DOM)
  • Simple API for XML (SAX)

15
Document Object Model (DOM)
  • Document Model driven
  • Build a tree model of the elements in the
    document
  • Allow for application to access the tree
  • DOM XML parser
  • Converts XML documents into Java Tree object model

16
Simple API for XML (SAX)
  • Event driven
  • SAX XML parser processes elements serially
  • XML application provides callback functions to
    handle elements

17
Freely Available XML Parsers
  • Apache Software Foundation Xerces XML Parser
    (xml.apache.org)
  • Open source
  • Oracle XML Parser Version 2 (www.oracle.com/xml)
  • Must register
  • SAX2 Parser (www.megginsion.com/SAX)
  • Freely available

18
References
  • http//www.w3.org/XML
  • http//www.xml.com
  • http//www.w3schools.com/xml/default.asp
Write a Comment
User Comments (0)
About PowerShow.com