to the main page... about these slides...

A tiny example

Recall the business card example from the DSD section:
 <card type="simple">
   <name>John Doe</name>
   <title>CEO, Widget Inc.</title>
   <phone>(202) 456-1414</phone>

We define an XHTML rendering semantics for our business-card markup language using an XSLT stylesheet:
 <xsl:stylesheet xmlns:xsl="" version="1.0"
   <xsl:template match="card[@type='simple']">
     <html xmlns="">
       <title>business card</title><body>
         <xsl:apply-templates select="name"/>
         <xsl:apply-templates select="title"/>
         <xsl:apply-templates select="email"/>
         <xsl:apply-templates select="phone"/>
   <xsl:template match="card/name">
     <h1><xsl:value-of select="text()"/></h1>
   <xsl:template match="email">
     <p>email: <a href="mailto:{text()}"><tt>
       <xsl:value-of select="text()"/>


Resulting document:
 <html xmlns=""><title>business card</title>
 <body><h1>John Doe</h1><h3><i>CEO, Widget Inc.</i></h3>
 <p>email: <a href=""><tt></tt></a></p>
 <p>phone: (202) 456-1414</p>

A browser might show this as:

John Doe

CEO, Widget Inc.


phone: (202) 456-1414