SlideShare a Scribd company logo
1 of 39
XML and XSL
Institutional Web Management 2001:
Organising Chaos
Running order

Background

All about XML

All about XSL

Hands-on XML and XSL

Publishing engines

Example applications

Crystal balls
Background

Mark Ray and Andrew Savory

Using XML since 1996

Used a variety of tools and methods
XML and XSL

W3C specifications

Separation of Concerns
 Reuse of data
 Multiple output formats
 Styles tailored to reader / Standardised styles
Applications of XML and XSL

Static information
 Institutional web sites
 Prospectuses
 Course catalogues

Dynamic information
 News or event information services
 Course catalogues
 Staff directories
Benefits of XML and XSL

Standards-based, format-independent

Serve sites and formats based on user need
 Text-based (text readers, slow links, low-tech)
 Netscape / Internet Explorer specifc
 TV, Phone, PDA
 PDF, SVG, VRML, ...

Simplification of web site management...
The management bit

Management
 Decide what the site
should contain, how
it should behave and
how it should appear

Content
 Responsible for
writing, owning,
managing the site
content
The management bit
 Logic
 Responsible for
integration with
dynamic content
generation
 Style
 Responsible for
information
presentation, look &
feel, site graphics
and maintenance
What is XML?

eXtensible Markup Language
 Not a fixed format
 'Metalanguage'
 For describing information
XML Design Goals
1 XML shall be straightforwardly usable over the
Internet.
2 XML shall support a wide variety of applications.
3 XML shall be compatible with SGML.
4 It shall be easy to write programs which process
XML documents.
5 The number of optional features in XML is to be
kept to the absolute minimum, ideally zero.
XML Design Goals
6 XML documents should be human-legible and
reasonably clear.
7 The XML design should be prepared quickly.
8 The design of XML shall be formal and concise.
9 XML documents shall be easy to create.
10Terseness is of minimal importance.
Structure of an XML document
<?xml version="1.0"?>
<PARENT>
<CHILD>
This is content.
</CHILD>
<EMPTY/>
</PARENT>
A first XML document
Construct a well-formed XML document using
the following tags:
 xml opening tag
 page
 title
 content
 para
Don't forget to add the closing tags!
Differences to HTML

Order:
<tag1><tag2></tag1></tag2> WRONG
<tag1><tag2></tag2></tag1> RIGHT

Balance
<tag1><tag2></tag2> WRONG
<tag1><tag2></tag2></tag1> RIGHT

Case
<tag1><tag2></TAG2></TAG1> WRONG
<tag1><tag2></tag2></tag1> RIGHT
Differences to HTML

Attributes
<tag1 class=wrong> WRONG
<tag1 class="right"> RIGHT

Empty Tags
<tag1 class="wrong"> WRONG
<tag1 class="wrong" /> RIGHT

XML is stricter
...and therefore better!
Well-formed vs. Valid

Exactly what they say:
 Well-formed means it's written correctly
 Valid means we can validate it
A well-formed example
<?xml version="1.0"?>
<PARENT>
<CHILD>
<MARK NUMBER="1" LISTED="yes" TYPE="natural"/>
<NAME>
<LASTNAME>child</LASTNAME>
<FIRSTNAME>second</FIRSTNAME>
</NAME>
</CHILD>
</PARENT>
A valid example
<?xml version="1.0"?>
<!DOCTYPE PARENT [
<!ELEMENT PARENT (CHILD*)>
<!ELEMENT CHILD (MARK?,NAME+)>
<!ELEMENT MARK EMPTY>
<!ELEMENT NAME (LASTNAME+,FIRSTNAME+)*>
<!ELEMENT LASTNAME (#PCDATA)>
<!ELEMENT FIRSTNAME (#PCDATA)>
<!ATTLIST MARK
NUMBER ID #REQUIRED
LISTED CDATA #FIXED "yes"
TYPE (natural|adopted) "natural">
<!ENTITY STATEMENT "This is well-formed XML">
]>
<PARENT>
&STATEMENT;
<CHILD>
<MARK NUMBER="1" LISTED="yes" TYPE="natural"/>
<NAME>
<LASTNAME>child</LASTNAME>
<FIRSTNAME>second</FIRSTNAME>
</NAME>
</CHILD>
</PARENT>
Document Type Definitions

First standard mechanism for XML validation

Define the role and structure of XML
elements

Sufficient for simple XML schemas

Don't support namespaces

Use non-XML syntax
XSchema

XML structural definition language of choice

Defines a class of XML document

Supports name spaces

More powerful
Xschema example
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Example Schema for IWM workshop
</xsd:documentation>
</xsd:annotation>
<xsd:element name="page" type="page"/>
<xsd:complexType name="page">
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="content" type="pageContent"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="pageContent">
<xsd:sequence>
<xsd:element name="para" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
What is XSL?

Preferred style sheet language of XML
 a method for transforming XML documents
 a method for defining XML parts and patterns
 a method for formatting XML documents

An application of XML (same formatting
rules)
Hands-on XML

Create the following XML document:
<?xml version="1.0"?>
<page>
<title>Hello</title>
<content>
<para>This is my first XML page!</para>
</content>
</page>

Save it as hello_world.xml
Uploading the file

Navigate to the site provided

Click on "upload.html"

Beside the "file to upload" box, click on
"choose"

Select the file you want to upload

Click on "upload"
Viewing the file
If you see the file you wanted to upload and
receive a "File written successfully" message...

Click on "Content", then the name of the file
Structure of an XSL stylesheet

Most templates have the following form:
<xsl:template match="emphasis">
<i><xsl:apply-templates/></i>
</xsl:template>

The whole <xsl:template> element is a
template

The match pattern determines where this
template applies
Structure of an XSL stylesheet

Literal result element(s) come from non-XSL
namespace(s)

XSLT elements come from the XSL
namespace
Hands-on XSL

Create the following XSL stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head>
<title><xsl:value-of select="title"/></title>
</head>
<body bgcolor="white" alink="red" link="blue" vlink="blue">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Uploading the file

Navigate to the site provided

Click on "upload.html"

Beside the "file to upload" box, click on
"choose"

Select the file you want to upload

Click on "upload"
Publishing engines

Cocoon
 Java-based

AxKit
 Perl-based

4Suite
 Python

Others or roll your own
Viewing the file
If you see the file you wanted to upload and
receive a "File written successfully" message...

Click on "View site in cocoon"

Select the file you uploaded and the
stylesheet you want to view it in
Hands-on XSL

Add the following to the XSL stylesheet:
<xsl:template match="title">
<h2 style="color: navy; text-align: center">
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="para">
<p align="left">
<i><xsl:apply-templates/></i>
</p>
</xsl:template>
New platforms, new beginnings?

The old way of publishing
 Repurposing

The new way of publishing
 Target multiple platforms
 Multiple stylesheets
 Multiple formats
Browser-specific content
<map:select>
<map:when test="lynx">
<map:transform src="stylesheets/simple-page2html-lynx.xsl"/>
</map:when>
<map:otherwise>
<map:transform src="stylesheets/simple-page2html.xsl"/>
</map:otherwise>
</map:select>
Lynx-friendly XSL stylesheet

Add the following to your XSL stylesheet:
<h2>This site is lynx-friendly</h2>

Save the stylesheet as
simple-page2html-lynx.xsl
Uploading the file

Navigate to the site provided

Click on "upload.html"

Beside the "file to upload" box, click on
"choose"

Select the file you want to upload

Click on "upload"
Viewing the file
If you see the file you wanted to upload and
receive a "File written successfully" message...

Click on "View site in cocoon"

Select the file you uploaded and the
stylesheet you want to view it in
Where next?

The semantic web
References

http://www.ibm.com/developerworks/papers.nsf/dw

http://www.xml101.com/

http://nwalsh.com/docs/tutorials/xsl/

More Related Content

What's hot (15)

Xml part2
Xml part2Xml part2
Xml part2
 
paper about xml
paper about xmlpaper about xml
paper about xml
 
Xml part4
Xml part4Xml part4
Xml part4
 
Xml material
Xml materialXml material
Xml material
 
Cascading style-sheet-
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
 
Rancangan Jaringan Komputer
Rancangan Jaringan KomputerRancangan Jaringan Komputer
Rancangan Jaringan Komputer
 
Xml part5
Xml part5Xml part5
Xml part5
 
Xml schema
Xml schemaXml schema
Xml schema
 
Introduction to XSLT
Introduction to XSLTIntroduction to XSLT
Introduction to XSLT
 
XSLT. Basic.
XSLT. Basic.XSLT. Basic.
XSLT. Basic.
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
XML/XSLT
XML/XSLTXML/XSLT
XML/XSLT
 
XML XSLT
XML XSLTXML XSLT
XML XSLT
 
XSLT
XSLTXSLT
XSLT
 
XSLT
XSLTXSLT
XSLT
 

Viewers also liked

Que es una rss,como funciona y para que se utiliza
Que es una rss,como funciona y para que se utiliza Que es una rss,como funciona y para que se utiliza
Que es una rss,como funciona y para que se utiliza Orlando Velez Giron
 
IWMW 2001: Automated News Feeds (4)
IWMW 2001: Automated News Feeds (4)IWMW 2001: Automated News Feeds (4)
IWMW 2001: Automated News Feeds (4)IWMW
 
MoD Spox En 26.09 2
MoD Spox En 26.09 2MoD Spox En 26.09 2
MoD Spox En 26.09 2UAReforms
 
IWMW 2001: What Students Want
IWMW 2001: What Students WantIWMW 2001: What Students Want
IWMW 2001: What Students WantIWMW
 
MoD Spox November 21, 2016
MoD Spox November 21, 2016MoD Spox November 21, 2016
MoD Spox November 21, 2016UAReforms
 
Understanding Lean and Agile
Understanding Lean and AgileUnderstanding Lean and Agile
Understanding Lean and AgileZornitsa Nikolova
 
IWMW 2001: Web Site Redevelopment (2)
IWMW 2001: Web Site Redevelopment (2)IWMW 2001: Web Site Redevelopment (2)
IWMW 2001: Web Site Redevelopment (2)IWMW
 
Макроекономічний та монетарний огляд НБУ за липень 2016 року
Макроекономічний та монетарний огляд НБУ за липень 2016 рокуМакроекономічний та монетарний огляд НБУ за липень 2016 року
Макроекономічний та монетарний огляд НБУ за липень 2016 рокуtsnua
 
Reinventing Diversity and Your Role as HR Professionals in an Era of Disruption
Reinventing Diversity and Your Role as HR Professionals in an Era of DisruptionReinventing Diversity and Your Role as HR Professionals in an Era of Disruption
Reinventing Diversity and Your Role as HR Professionals in an Era of DisruptionShirley Davis
 
inline block elements
inline block elementsinline block elements
inline block elementsRaynaITSTEP
 
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...Міністерство інфраструктури України
 
Присутствие иностранных банков в Украине
Присутствие иностранных банков в УкраинеПрисутствие иностранных банков в Украине
Присутствие иностранных банков в УкраинеRoman Kornyliuk
 

Viewers also liked (16)

Que es una rss,como funciona y para que se utiliza
Que es una rss,como funciona y para que se utiliza Que es una rss,como funciona y para que se utiliza
Que es una rss,como funciona y para que se utiliza
 
IWMW 2001: Automated News Feeds (4)
IWMW 2001: Automated News Feeds (4)IWMW 2001: Automated News Feeds (4)
IWMW 2001: Automated News Feeds (4)
 
MoD Spox En 26.09 2
MoD Spox En 26.09 2MoD Spox En 26.09 2
MoD Spox En 26.09 2
 
IWMW 2001: What Students Want
IWMW 2001: What Students WantIWMW 2001: What Students Want
IWMW 2001: What Students Want
 
MoD Spox November 21, 2016
MoD Spox November 21, 2016MoD Spox November 21, 2016
MoD Spox November 21, 2016
 
Understanding Lean and Agile
Understanding Lean and AgileUnderstanding Lean and Agile
Understanding Lean and Agile
 
Next generation enterprise
Next generation enterpriseNext generation enterprise
Next generation enterprise
 
IWMW 2001: Web Site Redevelopment (2)
IWMW 2001: Web Site Redevelopment (2)IWMW 2001: Web Site Redevelopment (2)
IWMW 2001: Web Site Redevelopment (2)
 
Макроекономічний та монетарний огляд НБУ за липень 2016 року
Макроекономічний та монетарний огляд НБУ за липень 2016 рокуМакроекономічний та монетарний огляд НБУ за липень 2016 року
Макроекономічний та монетарний огляд НБУ за липень 2016 року
 
Reinventing Diversity and Your Role as HR Professionals in an Era of Disruption
Reinventing Diversity and Your Role as HR Professionals in an Era of DisruptionReinventing Diversity and Your Role as HR Professionals in an Era of Disruption
Reinventing Diversity and Your Role as HR Professionals in an Era of Disruption
 
Рада реформ. Команда підтримки реформ
Рада реформ. Команда підтримки реформРада реформ. Команда підтримки реформ
Рада реформ. Команда підтримки реформ
 
inline block elements
inline block elementsinline block elements
inline block elements
 
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...
Рекомендаційний посібник «Система управління безпекою руху на автомобільному ...
 
Online book store
Online book storeOnline book store
Online book store
 
Присутствие иностранных банков в Украине
Присутствие иностранных банков в УкраинеПрисутствие иностранных банков в Украине
Присутствие иностранных банков в Украине
 
Bobwhite Quail Agenda
Bobwhite Quail AgendaBobwhite Quail Agenda
Bobwhite Quail Agenda
 

Similar to XML and XSL: Organising Chaos with Standards

Similar to XML and XSL: Organising Chaos with Standards (20)

Xml
XmlXml
Xml
 
The Ebook Developer's Toolbox - ebookcraft 2016 - Sanders Kleinfeld
The Ebook Developer's Toolbox - ebookcraft 2016 - Sanders Kleinfeld The Ebook Developer's Toolbox - ebookcraft 2016 - Sanders Kleinfeld
The Ebook Developer's Toolbox - ebookcraft 2016 - Sanders Kleinfeld
 
"Getting Started with XSLT" presentation slides
"Getting Started with XSLT" presentation slides"Getting Started with XSLT" presentation slides
"Getting Started with XSLT" presentation slides
 
Introduction to xml schema
Introduction to xml schemaIntroduction to xml schema
Introduction to xml schema
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit II
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Xml material
Xml materialXml material
Xml material
 
Xml material
Xml materialXml material
Xml material
 
XML - The Extensible Markup Language
XML - The Extensible Markup LanguageXML - The Extensible Markup Language
XML - The Extensible Markup Language
 
Xml
XmlXml
Xml
 
XSLT for Web Developers
XSLT for Web DevelopersXSLT for Web Developers
XSLT for Web Developers
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Full xml
Full xmlFull xml
Full xml
 
Transforming xml with XSLT
Transforming  xml with XSLTTransforming  xml with XSLT
Transforming xml with XSLT
 
Xsd
XsdXsd
Xsd
 
Xsd
XsdXsd
Xsd
 
Web programming unit IIII XML &DOM NOTES BY BHAVSINGH MALOTH
Web programming unit IIII XML &DOM NOTES BY BHAVSINGH MALOTHWeb programming unit IIII XML &DOM NOTES BY BHAVSINGH MALOTH
Web programming unit IIII XML &DOM NOTES BY BHAVSINGH MALOTH
 
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
 

More from IWMW

Look who's talking now
Look who's talking nowLook who's talking now
Look who's talking nowIWMW
 
Introduction to IWMW 2000 (Liz Lyon)
Introduction to IWMW 2000 (Liz Lyon)Introduction to IWMW 2000 (Liz Lyon)
Introduction to IWMW 2000 (Liz Lyon)IWMW
 
Web Tools report
Web Tools reportWeb Tools report
Web Tools reportIWMW
 
Personal Contingency Plan - Beat The Panic
Personal Contingency Plan - Beat The PanicPersonal Contingency Plan - Beat The Panic
Personal Contingency Plan - Beat The PanicIWMW
 
Whose site is it anyway?
Whose site is it anyway?Whose site is it anyway?
Whose site is it anyway?IWMW
 
Open Source - the case against
Open Source - the case againstOpen Source - the case against
Open Source - the case againstIWMW
 
IWMW 2002: Avoiding Portal Wars - an MIS view
IWMW 2002: Avoiding Portal Wars - an MIS viewIWMW 2002: Avoiding Portal Wars - an MIS view
IWMW 2002: Avoiding Portal Wars - an MIS viewIWMW
 
What does open source mean for the institutional web manager?
What does open source mean for the institutional web manager?What does open source mean for the institutional web manager?
What does open source mean for the institutional web manager?IWMW
 
Library 2.0
Library 2.0Library 2.0
Library 2.0IWMW
 
Social participation in student recruitment
Social participation in student recruitmentSocial participation in student recruitment
Social participation in student recruitmentIWMW
 
Supporting Institutions in Changing Times: Manifesto
Supporting Institutions in Changing Times: ManifestoSupporting Institutions in Changing Times: Manifesto
Supporting Institutions in Changing Times: ManifestoIWMW
 
IWMW 2019 photo scavenger hunt highlights
IWMW 2019 photo scavenger hunt highlightsIWMW 2019 photo scavenger hunt highlights
IWMW 2019 photo scavenger hunt highlightsIWMW
 
How to Turn a Web Strategy into Web Services
How to Turn a Web Strategy into Web ServicesHow to Turn a Web Strategy into Web Services
How to Turn a Web Strategy into Web ServicesIWMW
 
Static Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionStatic Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionIWMW
 
Looking to the Future
Looking to the FutureLooking to the Future
Looking to the FutureIWMW
 
Looking to the Future
Looking to the FutureLooking to the Future
Looking to the FutureIWMW
 
Developing Communities of Practice
Developing Communities of PracticeDeveloping Communities of Practice
Developing Communities of PracticeIWMW
 
How to train your content- so it doesn't slow you down...
How to train your content- so it doesn't slow you down... How to train your content- so it doesn't slow you down...
How to train your content- so it doesn't slow you down... IWMW
 
Grassroots & Guerrillas: The Beginnings of a UX Revolution
Grassroots & Guerrillas: The Beginnings of a UX RevolutionGrassroots & Guerrillas: The Beginnings of a UX Revolution
Grassroots & Guerrillas: The Beginnings of a UX RevolutionIWMW
 
Connecting Your Content: How to Save Time and Improve Content Quality through...
Connecting Your Content: How to Save Time and Improve Content Quality through...Connecting Your Content: How to Save Time and Improve Content Quality through...
Connecting Your Content: How to Save Time and Improve Content Quality through...IWMW
 

More from IWMW (20)

Look who's talking now
Look who's talking nowLook who's talking now
Look who's talking now
 
Introduction to IWMW 2000 (Liz Lyon)
Introduction to IWMW 2000 (Liz Lyon)Introduction to IWMW 2000 (Liz Lyon)
Introduction to IWMW 2000 (Liz Lyon)
 
Web Tools report
Web Tools reportWeb Tools report
Web Tools report
 
Personal Contingency Plan - Beat The Panic
Personal Contingency Plan - Beat The PanicPersonal Contingency Plan - Beat The Panic
Personal Contingency Plan - Beat The Panic
 
Whose site is it anyway?
Whose site is it anyway?Whose site is it anyway?
Whose site is it anyway?
 
Open Source - the case against
Open Source - the case againstOpen Source - the case against
Open Source - the case against
 
IWMW 2002: Avoiding Portal Wars - an MIS view
IWMW 2002: Avoiding Portal Wars - an MIS viewIWMW 2002: Avoiding Portal Wars - an MIS view
IWMW 2002: Avoiding Portal Wars - an MIS view
 
What does open source mean for the institutional web manager?
What does open source mean for the institutional web manager?What does open source mean for the institutional web manager?
What does open source mean for the institutional web manager?
 
Library 2.0
Library 2.0Library 2.0
Library 2.0
 
Social participation in student recruitment
Social participation in student recruitmentSocial participation in student recruitment
Social participation in student recruitment
 
Supporting Institutions in Changing Times: Manifesto
Supporting Institutions in Changing Times: ManifestoSupporting Institutions in Changing Times: Manifesto
Supporting Institutions in Changing Times: Manifesto
 
IWMW 2019 photo scavenger hunt highlights
IWMW 2019 photo scavenger hunt highlightsIWMW 2019 photo scavenger hunt highlights
IWMW 2019 photo scavenger hunt highlights
 
How to Turn a Web Strategy into Web Services
How to Turn a Web Strategy into Web ServicesHow to Turn a Web Strategy into Web Services
How to Turn a Web Strategy into Web Services
 
Static Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionStatic Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource Condition
 
Looking to the Future
Looking to the FutureLooking to the Future
Looking to the Future
 
Looking to the Future
Looking to the FutureLooking to the Future
Looking to the Future
 
Developing Communities of Practice
Developing Communities of PracticeDeveloping Communities of Practice
Developing Communities of Practice
 
How to train your content- so it doesn't slow you down...
How to train your content- so it doesn't slow you down... How to train your content- so it doesn't slow you down...
How to train your content- so it doesn't slow you down...
 
Grassroots & Guerrillas: The Beginnings of a UX Revolution
Grassroots & Guerrillas: The Beginnings of a UX RevolutionGrassroots & Guerrillas: The Beginnings of a UX Revolution
Grassroots & Guerrillas: The Beginnings of a UX Revolution
 
Connecting Your Content: How to Save Time and Improve Content Quality through...
Connecting Your Content: How to Save Time and Improve Content Quality through...Connecting Your Content: How to Save Time and Improve Content Quality through...
Connecting Your Content: How to Save Time and Improve Content Quality through...
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

XML and XSL: Organising Chaos with Standards

  • 1. XML and XSL Institutional Web Management 2001: Organising Chaos
  • 2. Running order  Background  All about XML  All about XSL  Hands-on XML and XSL  Publishing engines  Example applications  Crystal balls
  • 3. Background  Mark Ray and Andrew Savory  Using XML since 1996  Used a variety of tools and methods
  • 4. XML and XSL  W3C specifications  Separation of Concerns  Reuse of data  Multiple output formats  Styles tailored to reader / Standardised styles
  • 5. Applications of XML and XSL  Static information  Institutional web sites  Prospectuses  Course catalogues  Dynamic information  News or event information services  Course catalogues  Staff directories
  • 6. Benefits of XML and XSL  Standards-based, format-independent  Serve sites and formats based on user need  Text-based (text readers, slow links, low-tech)  Netscape / Internet Explorer specifc  TV, Phone, PDA  PDF, SVG, VRML, ...  Simplification of web site management...
  • 7. The management bit  Management  Decide what the site should contain, how it should behave and how it should appear  Content  Responsible for writing, owning, managing the site content
  • 8. The management bit  Logic  Responsible for integration with dynamic content generation  Style  Responsible for information presentation, look & feel, site graphics and maintenance
  • 9. What is XML?  eXtensible Markup Language  Not a fixed format  'Metalanguage'  For describing information
  • 10. XML Design Goals 1 XML shall be straightforwardly usable over the Internet. 2 XML shall support a wide variety of applications. 3 XML shall be compatible with SGML. 4 It shall be easy to write programs which process XML documents. 5 The number of optional features in XML is to be kept to the absolute minimum, ideally zero.
  • 11. XML Design Goals 6 XML documents should be human-legible and reasonably clear. 7 The XML design should be prepared quickly. 8 The design of XML shall be formal and concise. 9 XML documents shall be easy to create. 10Terseness is of minimal importance.
  • 12. Structure of an XML document <?xml version="1.0"?> <PARENT> <CHILD> This is content. </CHILD> <EMPTY/> </PARENT>
  • 13. A first XML document Construct a well-formed XML document using the following tags:  xml opening tag  page  title  content  para Don't forget to add the closing tags!
  • 14. Differences to HTML  Order: <tag1><tag2></tag1></tag2> WRONG <tag1><tag2></tag2></tag1> RIGHT  Balance <tag1><tag2></tag2> WRONG <tag1><tag2></tag2></tag1> RIGHT  Case <tag1><tag2></TAG2></TAG1> WRONG <tag1><tag2></tag2></tag1> RIGHT
  • 15. Differences to HTML  Attributes <tag1 class=wrong> WRONG <tag1 class="right"> RIGHT  Empty Tags <tag1 class="wrong"> WRONG <tag1 class="wrong" /> RIGHT  XML is stricter ...and therefore better!
  • 16. Well-formed vs. Valid  Exactly what they say:  Well-formed means it's written correctly  Valid means we can validate it
  • 17. A well-formed example <?xml version="1.0"?> <PARENT> <CHILD> <MARK NUMBER="1" LISTED="yes" TYPE="natural"/> <NAME> <LASTNAME>child</LASTNAME> <FIRSTNAME>second</FIRSTNAME> </NAME> </CHILD> </PARENT>
  • 18. A valid example <?xml version="1.0"?> <!DOCTYPE PARENT [ <!ELEMENT PARENT (CHILD*)> <!ELEMENT CHILD (MARK?,NAME+)> <!ELEMENT MARK EMPTY> <!ELEMENT NAME (LASTNAME+,FIRSTNAME+)*> <!ELEMENT LASTNAME (#PCDATA)> <!ELEMENT FIRSTNAME (#PCDATA)> <!ATTLIST MARK NUMBER ID #REQUIRED LISTED CDATA #FIXED "yes" TYPE (natural|adopted) "natural"> <!ENTITY STATEMENT "This is well-formed XML"> ]> <PARENT> &STATEMENT; <CHILD> <MARK NUMBER="1" LISTED="yes" TYPE="natural"/> <NAME> <LASTNAME>child</LASTNAME> <FIRSTNAME>second</FIRSTNAME> </NAME> </CHILD> </PARENT>
  • 19. Document Type Definitions  First standard mechanism for XML validation  Define the role and structure of XML elements  Sufficient for simple XML schemas  Don't support namespaces  Use non-XML syntax
  • 20. XSchema  XML structural definition language of choice  Defines a class of XML document  Supports name spaces  More powerful
  • 21. Xschema example <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:annotation> <xsd:documentation xml:lang="en"> Example Schema for IWM workshop </xsd:documentation> </xsd:annotation> <xsd:element name="page" type="page"/> <xsd:complexType name="page"> <xsd:sequence> <xsd:element name="title" type="xsd:string"/> <xsd:element name="content" type="pageContent"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="pageContent"> <xsd:sequence> <xsd:element name="para" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
  • 22. What is XSL?  Preferred style sheet language of XML  a method for transforming XML documents  a method for defining XML parts and patterns  a method for formatting XML documents  An application of XML (same formatting rules)
  • 23. Hands-on XML  Create the following XML document: <?xml version="1.0"?> <page> <title>Hello</title> <content> <para>This is my first XML page!</para> </content> </page>  Save it as hello_world.xml
  • 24. Uploading the file  Navigate to the site provided  Click on "upload.html"  Beside the "file to upload" box, click on "choose"  Select the file you want to upload  Click on "upload"
  • 25. Viewing the file If you see the file you wanted to upload and receive a "File written successfully" message...  Click on "Content", then the name of the file
  • 26. Structure of an XSL stylesheet  Most templates have the following form: <xsl:template match="emphasis"> <i><xsl:apply-templates/></i> </xsl:template>  The whole <xsl:template> element is a template  The match pattern determines where this template applies
  • 27. Structure of an XSL stylesheet  Literal result element(s) come from non-XSL namespace(s)  XSLT elements come from the XSL namespace
  • 28. Hands-on XSL  Create the following XSL stylesheet: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="page"> <html> <head> <title><xsl:value-of select="title"/></title> </head> <body bgcolor="white" alink="red" link="blue" vlink="blue"> <xsl:apply-templates/> </body> </html> </xsl:template> </xsl:stylesheet>
  • 29. Uploading the file  Navigate to the site provided  Click on "upload.html"  Beside the "file to upload" box, click on "choose"  Select the file you want to upload  Click on "upload"
  • 30. Publishing engines  Cocoon  Java-based  AxKit  Perl-based  4Suite  Python  Others or roll your own
  • 31. Viewing the file If you see the file you wanted to upload and receive a "File written successfully" message...  Click on "View site in cocoon"  Select the file you uploaded and the stylesheet you want to view it in
  • 32. Hands-on XSL  Add the following to the XSL stylesheet: <xsl:template match="title"> <h2 style="color: navy; text-align: center"> <xsl:apply-templates/> </h2> </xsl:template> <xsl:template match="para"> <p align="left"> <i><xsl:apply-templates/></i> </p> </xsl:template>
  • 33. New platforms, new beginnings?  The old way of publishing  Repurposing  The new way of publishing  Target multiple platforms  Multiple stylesheets  Multiple formats
  • 34. Browser-specific content <map:select> <map:when test="lynx"> <map:transform src="stylesheets/simple-page2html-lynx.xsl"/> </map:when> <map:otherwise> <map:transform src="stylesheets/simple-page2html.xsl"/> </map:otherwise> </map:select>
  • 35. Lynx-friendly XSL stylesheet  Add the following to your XSL stylesheet: <h2>This site is lynx-friendly</h2>  Save the stylesheet as simple-page2html-lynx.xsl
  • 36. Uploading the file  Navigate to the site provided  Click on "upload.html"  Beside the "file to upload" box, click on "choose"  Select the file you want to upload  Click on "upload"
  • 37. Viewing the file If you see the file you wanted to upload and receive a "File written successfully" message...  Click on "View site in cocoon"  Select the file you uploaded and the stylesheet you want to view it in

Editor's Notes

  1. How many people have heard of W3C?
  2. Web created to reduce information management costs by distributing back on information owners.
  3. How many people know what XML is? How many people have used it or seen it used? What context?
  4. How many people here have heard of XSL? How many people know what it is? How many people have used it?
  5. Explain the need for publishing engines Benefits of publishing engines over browser-based xml translations