Last Modified: 1/29/08
  Computer Training
Introduction to XML

Extensible Style Language (XSL)

The Extensible Style Language (XSL) is an extremely capable (and complicated) language that can select data from an XML file and prepare it for presentation in HTML.

Extensible Style Language: events5.xsl
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  <xsl:template match="/">
    <html>
      <body>
        <table cellspacing="0" width="100%">
            <tr>
              <td align="center" bgcolor="#ccccff">
                <b>Drama At The UW</b>
              </td>
            </tr>
       </table>
          <xsl:for-each select="events/play">
              <p>
                 <b><xsl:value-of select="title"/></b>
                  by <xsl:value-of select="author/First_Name"/>
                     <xsl:value-of select="author/Last_Name"/>
              </p>
          </xsl:for-each>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>


Referencing An XSL File From An XML File: events5.xml
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="events5.xsl"?>
<events>
  <play Ptype = "drama">
    <title>Three Sisters </title>
    <author>
      <First_Name>Anton</First_Name>
      <Last_Name>Chekhov</Last_Name>
    </author>
  </play>
  <play Ptype = "comedy">
    <title>As You Like It</title>
    <author>
      <First_Name>William</First_Name>
      <Last_Name>Shakespeare</Last_Name>
    </author>
  </play>
</events>


How It Appears In An XML-Capable Browser (MS IE5)
Browser View


Files

Resources

Previous Home Next

Topics

Summary

HTML Is Not Enough

What Is XML?
  Ontologies
  SGML, HTML, & XML

XML Basics
  HTML Example
  XML File
  Structure
  Paths
  Well-Formed
  DTDs
  Schemas
  Validation
  Unicode
  What It Means

Transforming For
Presentation

  DHTML
  CSS
  XSL

Serving And Processing XML
  Server Side
  Client Side

XML Applications   Information Reuse
  B2B
  Text Encoding
  Syndication

Security

XML Resources On The Web

Part Two Of Class

 
Previous Home Next

Other Topics:   XML Editors

©1999 UW Technology