Intro to XML
- 
 
- 
Outline
 
- 
Part I: XML Basics
 
- 
What is XML?
 
- 
XML is a Meta Markup Language
 
- 
XML describes structure and semantics, not formatting
 
- 
A Song Description in HTML
 
- 
A Song Description in XML
 
- 
Style Sheets provide formatting
 
- 
Attaching style sheets to documents
 
- 
What is XML used for?
 
- 
Domain-Specific Markup Languages
 
- 
Self-Describing Data
 
- 
An XML Fragment
 
- 
Interchange of Data Among Applications
 
- 
Structured and Integrated Data
 
- 
XML Applications
 
- 
Example XML Applications
 
- 
Mathematical Markup Language
 
- 
Channel Definition Format
 
- 
Classic Literature
 
- 
Vector Graphics
 
- 
The Resource Description Framework (RDF)
 
- 
An Example of RDF
 
- 
XML for XML
 
- 
XSL: The Extensible Stylesheet Language
 
- 
DCD: The Document Content Description Schema Language
 
- 
XLL: The Extensible Linking Language
 
- 
File Formats, in-house applications, and other behind the scenes uses
 
- 
Hello XML
 
- 
The FOO element
 
- 
greeting.xml
 
- 
Style sheets
 
- 
xml-stylesheet
 
- 
greeting.css
 
- 
greeting.xsl
 
- 
Attaching a style sheet to an  XML document
 
- 
A larger example: Music Catalog
 
- 
Sample Catalog
 
- 
Organizing the Data
 
- 
What is the Root Element
 
- 
The Root Element
 
- 
What are the Immediate Children of the Root?
 
- 
Child Elements
 
- 
White space in XML is not especially significant
 
- 
Composers
 
- 
Grand Children
 
- 
Attributes
 
- 
Attributes vs. Elements
 
- 
When not to use attributes
 
- 
Compositions
 
- 
Each composition has a
 
- 
Composition Example in XML
 
- 
Further Divisions
 
- 
Attaching the Composer to the Composition
 
- 
Some Keywords For the Search Engines
 
- 
Standard Signature
 
- 
Cascading Style Sheets
 
- 
A Blank Style Sheet
 
- 
The Default Rule
 
- 
A style rule for the category element
 
- 
A style rule for the composer element
 
- 
A style rule for the title element
 
- 
A style rule for the catalog info
 
- 
Style rules for the signature
 
- 
Style Rules for composition children
 
- 
Finished Style Sheet
 
- 
Possible Extensions
 
- 
Possible Solutions
 
- 
CSS or XSL?
 
- 
Well-formedness Rules
 
- 
Open and close all tags
 
- 
Empty tags end with />
 
- 
There is a unique root element
 
- 
Elements may not overlap
 
- 
Attribute values are quoted
 
- 
< and & are only used to start tags and entities
 
- 
Only the five predefined entity references are used
 
- 
Questions?
 
- 
Part II: DTDs
 
- 
What is XML?
 
- 
XML is a Meta Markup Language
 
- 
A Song Description in HTML
 
- 
A Song Description in XML
 
- 
A DTD for Songs
 
- 
A Valid Song Document
 
- 
Validity
 
- 
Checking Validity
 
- 
What is XML used for?
 
- 
Domain-Specific Markup Languages
 
- 
Self-Describing Data
 
- 
Interchange of Data Among Applications
 
- 
Structured and Integrated Data
 
- 
XML Applications
 
- 
Well-formedness vs validity
 
- 
DTDs and Validity
 
- 
What is a DTD?
 
- 
The importance of validation
 
- 
A DTD for greeting.xml
 
- 
Document Type Declarations
 
- 
Invalid Documents
 
- 
Validating Tools
 
- 
Internal DTDs
 
- 
An Example Document
 
- 
Element Declarations
 
- 
Content Specifications
 
- 
ANY
 
- 
#PCDATA
 
- 
#PCDATA
 
- 
#PCDATA
 
- 
Comments in DTDs
 
- 
Child Elements
 
- 
Child Elements
 
- 
Sequences
 
- 
More Sequences
 
- 
One or More Children +
 
- 
Zero or More Children *
 
- 
Zero or One Children ?
 
- 
Choices
 
- 
Grouping With Parentheses
 
- 
Mixed Content
 
- 
Mixed Content
 
- 
Empty elements
 
- 
Content Models You Can't Declare
 
- 
Attribute Declarations
 
- 
Multiple Attribute Declarations
 
- 
Attribute Default Values
 
- 
#REQUIRED
 
- 
#IMPLIED
 
- 
#FIXED
 
- 
Attribute Types
 
- 
CDATA
 
- 
ID
 
- 
IDREF
 
- 
IDREFS
 
- 
Finished DTD
 
- 
ENTITY
 
- 
ENTITIES
 
- 
NOTATION
 
- 
NMTOKEN
 
- 
NMTOKENS
 
- 
Enumerated
 
- 
The description element
 
- 
XHTML
 
- 
XHTML strict DTD
 
- 
External Parameter Entity References
 
- 
Finished DTD
 
- 
Internal DTD Subsets
 
- 
Schemas
 
- 
Questions?
 
- 
Part III: XSL, the Extensible Style Language
 
- 
What Is XSL?
 
- 
Versions
 
- 
The Process of an  XSL Transformation
 
- 
An Example XML Document
 
- 
An XSL Style Sheet
 
- 
Output
 
- 
Templates
 
- 
The actual HTML output
 
- 
Adding the root
 
- 
The actual HTML output
 
- 
Applying Templates
 
- 
The actual HTML output
 
- 
The select attribute
 
- 
The actual HTML output
 
- 
Expanding the coverage
 
- 
The actual HTML output
 
- 
Attributes
 
- 
The actual HTML output
 
- 
Attribute Value Templates
 
- 
The actual HTML output
 
- 
xsl:copy
 
- 
The generated HTML
 
- 
The Or Operator in Match Patterns
 
- 
The * wildcard
 
- 
The node() and @* wildcards
 
- 
Are we being too greedy?
 
- 
Testing conditions with xsl:if
 
- 
The actual HTML output
 
- 
Matching composers with compositions
 
- 
Matching composers with compositions
 
- 
The actual HTML output
 
- 
Sorting with xsl:sort
 
- 
The actual HTML output
 
- 
Multiple Key Sorts
 
- 
The actual HTML output
 
- 
Sorting by Composition Title
 
- 
The actual HTML output
 
- 
xsl:for-each
 
- 
The actual HTML output
 
- 
Sorting the Table of Contents
 
- 
Adding Links from the Table of Contents
 
- 
The actual HTML output
 
- 
Numbering Output
 
- 
String functions
 
- 
substring()
 
- 
The actual HTML output
 
- 
Number Operators
 
- 
Number Functions
 
- 
Where Does the XML Transformation Happen?
 
- 
Client Side Processing
 
- 
A style sheet that works with Internet Explorer 5.0
 
- 
What else does XSL have?
 
- 
What does XSL not have?
 
- 
Summary
 
- 
To Learn More
 
- 
Questions?
 
- 
Part IV: XLinks and XPointers
 
- 
Three Technologies
 
- 
Versions
 
- 
HTML Links are Limited
 
- 
XLinks are More Powerful
 
- 
Application Support
 
- 
Linking Elements
 
- 
For example
 
- 
Declaring XLink Attributes in DTDs
 
- 
Fixed Attributes
 
- 
Other Attributes
 
- 
xlink:simple
 
- 
Descriptions of the Remote Resource
 
- 
role and title
 
- 
Link Behavior
 
- 
 xlink:show  
 
- 
xlink:actuate
 
- 
Parameter Entities for Link Attributes
 
- 
Extended Links
 
- 
Extended Link Elements
 
- 
Locators
 
- 
xlink:type="locator"
 
- 
xlink:locator
 
- 
Locators in DTDs
 
- 
Parameter Entities for these  DTDs
 
- 
Arcs
 
- 
xlink:arc
 
- 
Arc Traversal Behavior
 
- 
show, actuate, actuatedefault, showdefault
 
- 
xlink:show, xlink:actuate, xlink:actuatedefault, xlink:showdefault
 
- 
Declarations for Extended Link Attributes
 
- 
Out-of-Line Links and Extended Link Groups
 
- 
Extended Link Group Syntax
 
- 
Extended Link Example
 
- 
Extended Link Example
 
- 
Extended Link Example
 
- 
Or, Using Attribute Syntax
 
- 
XLink Summary
 
- 
Part V: XPointers
 
- 
What are XPointers?
 
- 
Why Use XPointers?
 
- 
Three Problems to Solve
 
- 
Named Anchors are HTML's solution
 
- 
XPointer Examples
 
- 
URIs with XPointers
 
- 
XLinks with XPointers
 
- 
Document Fragments
 
- 
A Concrete Example
 
- 
Location Steps
 
- 
Absolute Location Steps
 
- 
id()
 
- 
ID shortcut
 
- 
 The root /
 
- 
Relative Location Steps
 
- 
The Parts of a Relative Location Step
 
- 
The Twelve Relative Location Axes
 
- 
child
 
- 
descendant
 
- 
descendant-or-self
 
- 
parent
 
- 
self
 
- 
ancestor
 
- 
ancestor-or-self
 
- 
preceding
 
- 
following
 
- 
preceding-sibling
 
- 
following-sibling
 
- 
attribute
 
- 
Node Tests
 
- 
The wild card *
 
- 
text()
 
- 
comment()
 
- 
processing-instruction()
 
- 
Predicates
 
- 
XPointer Predicates are booleans
 
- 
position()
 
- 
String Location Terms
 
- 
Position and Length in String Location Terms
 
- 
Ranges
 
- 
Tumblers
 
- 
XPointer Summary
 
- 
Questions?
 
- 
Part VI: Programming with XML
 
- 
Programming with XML
 
- 
SAX, the Simple API for XML
 
- 
The Document Object Model (DOM)
 
- 
To Learn More
 
- 
Questions?
 
              Copyright 1999 
              Elliotte Rusty Harold
elharo@metalab.unc.edu
              Last Modified October 10, 1999