Title: XML: What, Why, When
1XML What, Why, When How?
- Hope Greenberg
- Center for Teaching Learning
- June 11 18
2The 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
3Recap 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
4XML The Pieces
XML What, Why, When and How
css
web
xhtml.xsl
XML File
print.xsl
pda.xsl
pda
DTD/Schema
Parser
5DTD vs. Schema
XML What, Why, When and How
- Schema
- Data Typing
- date field
- number field
- Expressed as XML
- Plural schemas!
6XML File The Pieces
XML What, Why, When and How
- Declaration
- Processing Instructions
- Elements
- (tag, attributes, content PCDATA)
- Entities
- Character, files,
- Comments
- CDATA
7XML 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)
8XML 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
9XML 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
10XML 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
11The Invitation
XML What, Why, When and How
12 XML What, Why, When and How
13(No Transcript)
14Building 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
15XSL 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
16XSLT
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
17Beginnings 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
18Then 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
19More 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
20Odds 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
21Next?
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
22Questions?
XML What, Why, When and How
- Hope Greenberg
- hope.greenberg_at_uvm.edu