X M L - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

X M L

Description:

all elements must have closing tag. tags are case sensitive ... XML declaration not part of XML document no closing tag note root element doc is a note ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 13
Provided by: kayebal
Learn more at: http://www.unc.edu
Category:
Tags: closing

less

Transcript and Presenter's Notes

Title: X M L


1
X M L
  • Extensible Markup Language

2
XML examples from -
www.w3schools.com
3
  • like HTML, but not a replacement
  • XML describes data. HTML displays data.
  • easier to expand and upgrade systems 
  • tags are user-defined
  • cross-platform
  • software and hardware independent

4
  • XML separates data from HTML
  • XML data is stored outside HTML
  • or stored inside HTML (Data Islands)
  • will be main language for
  • financial information exchange

5
  • stores data in plain text files
  • software- and hardware-independent data sharing.
  • easier to expand and upgrade systems 
  • stores data in databases and other files.
  • used to create new languages
  • WAP (Wireless Markup Language)
  • WML (Wireless Application Protocol).
  • markup Internet applications for handheld devices
  • Hopefully all future applications will do data
    exchange in XML.

6
  • XML Syntax
  • simple and strict
  • all elements must have closing tag
  • tags are case sensitive

7
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
    XML declaration not part of XML document no
    closing tag
  • ltnotegt
  • root element doc is a note
  • lttogtTovelt/togt
  • next 4 lines child elements to, from,
    heading, body
  • ltfromgtJanilt/fromgt
  • ltheadinggtReminderlt/headinggt
  • ltbodygtDon't forget me this weekend!lt/bodygt
  • lt/notegt
  • end of root element

8
XML Syntax
  • elements must be correctly nested
  • documents must have a root element
  • attribute values always in quotes
  • date12/11/2002
  • spacing is preserved
  • new line is always stored as LF (line feed)
  • comment syntax similar HTML comments

9
XML Elements
  • Documents can be extended to carry more
    information.
  • elements related - parents and children
  • Element is everything from element's start tag to
    end tag (including tags).
  • 4 types of element content
  • Element content
  • Mixed content
  • Simple content
  • Empty content
  • elements can have attributes

10
  • ltbookgt root element -
  • has element content because it has other
    elements in it (children)
  • lttitlegtMy First XMLlt/titlegt children, siblings or
    sisters (title, prod, chapter) have
    same parent
  • ltprod id"33-657" media"paper"gtlt/prodgt prod
    empty content
  • has attributes, but no information (attribute
    named media has value paper)
  • ltchaptergtIntroduction to XML
  • chapter - mixed content - has text and other
    elements
  • ltparagtWhat is HTMLlt/paragt
  • para - simple content (or text content)
    contains only text
  • ltparagtWhat is XMLlt/paragt
  • lt/chaptergt
  • ltchaptergtXML Syntax
  • ltparagtElements must have a closing taglt/paragt
  • ltparagtElements must be properly nestedlt/paragt

11
  • Element Naming Rules
  • can contain
  • letters, number, other characters
  • cannot start with
  • number, punctuation character, or letters xml,
    XML, Xml
  • cannot contain
  • spaces, hyphen (-), period (.), colon ()

12
The End
Write a Comment
User Comments (0)
About PowerShow.com