XML: What, Why, When - PowerPoint PPT Presentation

About This Presentation
Title:

XML: What, Why, When

Description:

Hon Men: CSS, XSL-FO, XPOINTER, XLINK, SAX, DOM. XML: What, Why, When and How. Recap: The Pieces ... XSL or CSS? CSS: Cascading StyleSheet. describes formatting ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 23
Provided by: comput120
Learn more at: https://www.uvm.edu
Category:
Tags: xml

less

Transcript and Presenter's Notes

Title: XML: What, Why, When


1
XML What, Why, When How?
  • Hope Greenberg
  • Center for Teaching Learning
  • June 11 18

2
The Plan
XML What, Why, When and How
  • Day One
  • Introduction/history, XML, XHTML
  • Day Two
  • Alphabet soup
  • DTDs,
  • XSL XSLT, XPATH
  • Hon Men CSS, XSL-FO, XPOINTER, XLINK, SAX, DOM

3
Recap The Pieces
XML What, Why, When and How
  • An xml file can be
  • Well-formed (follows general XML rules)
  • Valid (the above plus specific rules as defined
    in the DTD or Schema)
  • Parser checks the XML file for conformity
  • DTD/Schema defines the rules for the xml file
  • Stylesheet(s) defines how file will be displayed
    or used

4
XML The Pieces
XML What, Why, When and How
css
web
xhtml.xsl
XML File
print.xsl
pda.xsl
pda
DTD/Schema
Parser
5
DTD vs. Schema
XML What, Why, When and How
  • Schema
  • Data Typing
  • date field
  • number field
  • Expressed as XML
  • Plural schemas!

6
XML File The Pieces
XML What, Why, When and How
  • Declaration
  • Processing Instructions
  • Elements
  • (tag, attributes, content PCDATA)
  • Entities
  • Character, files,
  • Comments
  • CDATA

7
XML File The Pieces
XML What, Why, When and How
  • Declaration (what am I?)
  • Processing Instructions (what will you do with
    me?)
  • Elements (what am I made of?)
  • (tag, attributes, content PCDATA)
  • Entities (what else do we need?)
  • Character, files,
  • Comments (secret messages)
  • CDATA (just like this or else)

8
XML File The Pieces
XML What, Why, When and How
  • Declaration
  • lt?xml version1.0 encodingUTF-16
    standaloneyesgt
  • Processing instruction
  • lt?xml-stylesheet hrefclassic.xsl
    typetext/xml?gt

9
XML File The Pieces
XML What, Why, When and How
  • Elements
  • (tag, attributes, content PCDATA)
  • ltpgtHello World!lt/pgt
  • ltp typeclichedgtHello World!lt/pgt
  • Entities
  • Character
  • amp xDE
  • Text or other external
  • lt!ENTITY lady SYSTEM http//www.uvm.edu/hag/lady
    .jpeg NDATA jpeggt
  • ltfigure entityladygtlt/figuregt

10
XML File Some Rules
XML What, Why, When and How
  • XML documents use a self-describing syntax.
  • XML tags are case sensitive.
  • All XML elements must have a closing tag.
  • All XML elements must be properly nested.
  • All XML documents must have a root element.
  • Attribute values must always be quoted.
  • and think about what information you want to
    capture as well as how stylesheets might
    determine your choices

11
The Invitation
XML What, Why, When and How
12
XML What, Why, When and How
13
(No Transcript)
14
Building a DTD
XML What, Why, When and How
  • We will
  • Use Oxygen to create the file
  • Have it learn and save the structure
  • Explore the structure
  • Make some changes
  • Add an entity

15
XSL or CSS?
XML What, Why, When and How
  • CSS Cascading StyleSheet
  • describes formatting for structures
  • streams
  • XSL XSLT, XPATH, XSL-FO
  • XSLT T is for Transformation
  • XPATH find the matching pattern
  • XSL-FO format objects
  • trees

16
XSLT
XML What, Why, When and How
  • XSLT uses XPATH to find the parts of the source
    that match the template so it can transform the
    source into the result.

Source Tree
Result Tree
XSLT
17
Beginnings The Declaration
XML What, Why, When and How
  • Start with the correct declaration
  • ltxslstylesheet version1.0 xmlnsxsl
    http//www.w3c.org/1999/XSL/Transformgt
  • or
  • ltxsltransform version1.0 xmlnsxsl
    http//www.w3c.org/1999/XSL/Transformgt

18
Then What?
XML What, Why, When and How
  • Start adding templates
  • ltxsltemplate match"front"gt
  • lth1 align"center"gt
  • ltxslapply-templates/gt
  • lt/h1gt
  • lt/xsltemplategt

19
More Templates
XML What, Why, When and How
  • Selecting a value from an attribute
  • ltxsltemplate match"party"gt
  • lth2 align"center"gt
  • ltxslvalue-of select"_at_type"/gt
  • lt/h2gt
  • lt/xsltemplategt

20
Odds and Ends
XML What, Why, When and How
  • Some XML Applications
  • TEI Text Encoding Initiative
  • EAD Encoded Archival Description
  • Dublin Core Metadata
  • see Cover pages
  • http//www.coverpages.org

21
Next?
XML What, Why, When and How
  • What should you do about XML?
  • hint youre doing it!
  • What about XHTML?
  • Tidy up http//infohound.net/tidy
  • Google on
  • XML tutorial
  • XSL Tutorial
  • Try some software
  • http//www.xmlsoftware.com

22
Questions?
XML What, Why, When and How
  • Hope Greenberg
  • hope.greenberg_at_uvm.edu
Write a Comment
User Comments (0)
About PowerShow.com