Download presentation
Presentation is loading. Please wait.
1
XML by Jon Pearce
2
What is XML? XML = eXstensible Markup Language = a meta language for defining markup languages. Examples: MathML, SVG (Scalable Vector Graphics), WML (Wireless Markup Language), XBRL (Extensible Business Reporting Language), XUL (Extensible User Interface Language), PDML (Product Data Markul Language), CML (Chemical ML), VoiceXML, VML (Vector ML), cXML (Commerce XML), tpaML (Traqding partner agreement XML), SMBXML (Small to Medium Business XML), FinXML (Financial XML), SOAP, XHTML, OWL
3
XML History Standard Generalized Markup Language –Invented in 1980s for publishing industry –Markup meta language –HTML is an SGML language –Ancestor of XML
4
Uses of XML Data Storage –Object Serialization –Presentation Independent –Language Independent Application Initialization Message Passing –Between Tiers Data-Business-Presentation-Client –SOAP and Web Services
5
An XML Document Contains: A Prolog Elements content Comments CDATA Sections Processing Instructions (PIs)
6
Format of an XML Document ELEMENT ELEMENT...
7
Tree Structure of an XML Document
8
A Document Prolog Contains: XML Declaration DTD (optional) Style Sheet (optional) etc.
9
An XML Element Contains: content 09/01/2002 An empty element:
10
Example: book.xml PERSON PERSON PERSON...
11
A Person Element (1) NAME ADDRESS PHONE
12
A Person Element (2) Joe Smith 123 Sesame St New York NY (555) 555-1234
13
Displaying XML in IE
14
Grammars G = a grammar L(G) = Language defined by G w L(G) means w is a valid L(G) sentence Example: –G = English grammar –G = Java grammar
15
Grammar Rules An EBNF grammar is a list of rules of the form: –PARENT ::= CHILDREN CHILDREN is a regular expression: –A B, A | B, A*, A?, 'leaf'
16
Addresses EBNF ADDRESSES ::= PERSON* PERSON ::= NAME ADDRESS PHONE NAME ::= FIRST LAST ADDRESS ::= STREET CITY STATE PHONE, FIRST, LAST, STREET, CITY, STATE ::= STRING
17
addresses.dtd
18
book.xml (with a dtd) PERSON PERSON PERSON...
19
Well Formed vs. Valid Documents Validating Parsers determine if an XML document conforms to its DTD Non-validating parsers merely determine if an xml document is well formed
20
Extensible Style Sheet Language XSL is an XML language for describing a transformation An XSL document describes a transformation that transforms XML documents into xHTML documents
21
XSL Format HTML + XML instructions
22
XSL Markup... –selects each element in an XML document matching TAG and performs... –Displays the value of TAG
23
addresses.xsl Addresses Here are your addresses: name = phone =
24
book.xml (with an xsl) PERSON PERSON PERSON...
25
Displaying book.xml in IE (2)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.