Title: XML as Content Management
1- XML as Content Management
Prepared by the NYS Forum IT Accessibility
Committee http//www.nysforum.org/accessibility/re
sources/curriculum/xml
Presented by Michael B. Short November 17, 2006
2XML as Content Management
- Objective the learner will gain an overview of
using XML for content management on the web
3XML as Content Management
- A brief introduction to XML
- How XML separates content from presentation
- Leveraging XML for accessible web sites
- Some key issues facing XML developers
4XML an Introduction
- XML
- Extensible Markup Language
- a tag-based language for describing the contents
of documents - Two main flavors
- Pre-defined standards
- Self-defined grammars
5XML an Introduction
- Example
- ltbook isbn1-8493-9829-0gt
- lttitlegtInformation Security Managementlt/titlegt
- ltauthorgtHarold F. Tiptonlt/authorgt
- ltauthorgtMicki Krauselt/authorgt
- ltpublishergtAuerbachlt/publishergt
- ltyeargt2000lt/yeargt
- lt/bookgt
6XML an Introduction
- Consists of
- Elements (tags)
- Attributes (similar to HTML)
- Must have
- Root element
- (book tag from the previous example)
7XML an Introduction
- lt?xml version"1.0" encoding"iso-8859-1"?gt
- ltslidegt
- lttitlegtXML an Introductionlt/titlegt
- lttopic headerConsists ofgt
- ltbullet textElements (tags) /gt
- ltbullet textAttributes (similar to HTML) /gt
- lt/topicgt
- lttopic headerMust havegt
- ltbullet textRoot elementgt
- ltsubbullet text(book tag from the
previous example)/gt - lt/bulletgt
- lt/topicgt
- lt/slidegt
8XSLT
- Extensible Style sheet Language Translation
- XSL is XML
- Instructions for transforming XML into another
form - Could be instructions from rendering a document
in HTML - Or perhaps PDF
- Or virtually any other form
9XSLT (Snippet)
- ltxslfor-each selecttopicgt
- ltpgtltxslvalue-of selectheader /gtlt/pgt
- ltulgt
- ltxslfor-each selectbullet"gt
- ltligtltxslvalue-of select"." /gtlt/ligt
- lt/xslfor-eachgt
- lt/ulgt
- lt/xslfor-eachgt
10How XML Solves Accessibility Issues
- One style sheet can be applied to a multitude of
XML source documents - More than one style sheet can be applied to the
same source document
11How XML Solves Accessibility Issues
- One style sheet can be applied to a multitude of
XML source documents - The style sheet can be constructed to render
accessible, standard HTML - Once the style sheet is correct, any HTML
document generated using the style sheet will be
valid, standard and accessible
12XML can Separate Data from HTML
- When HTML is used to display data, the data is
stored inside your HTML - With XML, your data is stored outside your HTML
13XML can Separate Data from HTML
- With XML, data can be stored in separate XML
files - This way you can concentrate on using HTML for
data layout and display, and be sure that changes
in the underlying data will not require any
changes to your HTML.
14XML can Separate Data from HTML
- XML data can also be stored inside HTML pages as
"Data Islands". - You can still concentrate on using HTML only for
formatting and displaying the data.
15How XML Solves Accessibility Issues
- More than one style sheet can be applied to the
same source document - one style sheet to render HTML
- another style sheet to render PDF
- The same source document, guaranteeing the
same content, can be used to generate more than
one version for different uses
16How XML Solves Accessibility Issues
- Style sheets can be extended as new situations
arise - Declare new tags to manage the new situation
- Update the style sheet portfolio to render the
new tags - Handle the situation once for each style sheet
and all future documents meet the standard
17What happens today
- Modern browsers will perform the translation on
the fly when the source document and style sheet
are present - Older browsers display the source XML
- Thus, you cannot depend on client-side
translation yet
18Issues with Server-side XML
- XML requires a shift in thinking
- Separation of content and presentation is pretty
much complete - Source documents must meet strict formatting
requirements, requiring more discipline - Converting large sites requires a large effort