Wir wollen hier nicht noch einmal ausführlich erörtern, wie die HTML-Dateien zu Stande kommen, aber Sie sollen wenigstens den Vergleich zu WML haben. Auch das folgende Stylesheet erzeugt, wie erwähnt, alle Dateien auf einmal und auf dieselbe Weise (durch das Element saxon:output). Logischerweise ist die Auszeichnung hier anders — und vor allem ist das Ganze kürzer, weil die Längenbeschränkung von WML im Web nicht gilt. Das heißt, für jede Produktgruppe existiert schließlich eine HTML-Datei (siehe die Abbildung unten), die wiederum durch ein paar Variablen zusammengesetzt ist:
<saxon:output file="{$dir}{$filesep}{$thisandnow}.html" ... >
Ein Formular mit einer JavaScript-Zeile statt eines action-Attributs lässt von jeder HTML-Seite den Zugriff auf die anderen zu:
<select name="thema" onChange="location.href=this.options[selectedIndex].value+'.html'"> <option selected="selected" value="appsrv">Application Server</option> ... <option value="wbt">Windows-based Terminals</option> </select>
Abbildung 76: In HTML-Viewern können im Gegensatz zu Handys alle Application Server in einer Datei dargestellt werden
Unterschiede zwischen den beiden Stylesheets bestehen
natürlich vor allem darin, dass HTML über einen
reicheren Elementvorrat verfügtUnd
HTML-Viewer vertragen ein bisschen größere
Dateien ....
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40" xmlns:saxon="http://icl.com/saxon" saxon:trace="no" extension-element-prefixes="saxon"> <!-- Parameter und Variable --> <xsl:variable name="dir">html</xsl:variable> <xsl:variable name="filesep" select="system-property('file.separator')" /> <!-- ....................Root............... --> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <!-- ............Element cebit............... --> <xsl:template match="/cebit"> <xsl:apply-templates/> </xsl:template> <!-- .......P r o d u k t g r u p p e n...... --> <xsl:template match="appsrv|bluet|datam|intzu|java|linux|pki|san|sysm|unis|viren|wap|wbt"> <saxon:set-attribute name="diesthema" select="@thema"/> <xsl:variable name="thisandnow"> <xsl:value-of select="@diesthema"/> </xsl:variable> <saxon:output file="{$dir}{$filesep}{$thisandnow}.html" method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.0 Transitional"> <html> <head> <link rel="stylesheet" type="text/css" href="cebit.css" /> <title><xsl:value-of select="@longname"/></title> </head> <body> <xsl:comment> This file is generated: Don't even think about editing ;-) </xsl:comment> <h3> <img> <xsl:attribute name="src">/ix/images/2000/ix_logo_w.gif</xsl:attribute> <xsl:attribute name="alt">small iX logo</xsl:attribute> <xsl:attribute name="hspace">20</xsl:attribute> </img> <xsl:text>CeBIT-Führer Internet/Intranet</xsl:text> </h3> <a> <xsl:attribute name="href">/ix/2000/cebit/</xsl:attribute> <xsl:text>Zurück zum CeBIT-Special</xsl:text> </a> <table align="center"><tr><td align="right"> <form> <xsl:text>CeBIT-Special-Themen: </xsl:text> <select name="thema" onChange="location.href=this.options[selectedIndex].value+'.html'"> <option selected="selected" value="appsrv">Application Server</option> <option value="bluet">Bluetooth</option> <option value="datam">Data Mining</option> <option value="intzu">Internet-Zugang</option> <option value="java">Java-Entwicklungsumgebungen</option> <option value="linux">Linux</option> <option value="pki">Public Key Infrastructure</option> <option value="san">Storage Area Networks</option> <option value="sysm">Systemmanagement</option> <option value="unis">Forschung und Lehre</option> <option value="viren">Anti-Viren-Software</option> <option value="wap">WAP</option> <option value="wbt">Windows-based Terminals</option> </select> </form> </td></tr></table> <h1> <xsl:value-of select="@longname"/> </h1> <dl> <xsl:apply-templates select="group/firma"/> </dl> <hr> <xsl:attribute name="width">50%</xsl:attribute> <xsl:attribute name="size">1</xsl:attribute> <xsl:attribute name="noshade">noshade</xsl:attribute> </hr> <p class="notiz"> <xsl:text>Fragen/Anregungen bitte an: </xsl:text> <a> <xsl:attribute name="href">mailto:www@ix.heise.de</xsl:attribute> <xsl:text>www@ix.heise.de</xsl:text> </a> <xsl:text> ...</xsl:text> <br/> <xsl:text>Letzte Veränderung am 18. Februar 2000 von HB</xsl:text> </p> </body> </html> </saxon:output> </xsl:template> <!-- ............ die einzelnen Firmen......... --> <xsl:template match="firma"> <dt> <strong> <xsl:choose> <xsl:when test="./@url!=''"> <a> <xsl:attribute name="href"> <xsl:text>http://</xsl:text> <xsl:value-of select="./@url"/> </xsl:attribute> <xsl:apply-templates select="name"/> </a> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="name"/> </xsl:otherwise> </xsl:choose> </strong> </dt> <dd> <xsl:text>Halle</xsl:text> <xsl:apply-templates select="halle"/> <xsl:text>, Stand </xsl:text> <xsl:apply-templates select="stand"/> <xsl:text> (Produkt: </xsl:text> <xsl:apply-templates select="produkt"/> <xsl:text>)</xsl:text> </dd> </xsl:template> <!-- Templates fuer Name, Halle, Stand, Produkt --> <xsl:template match="name"> <xsl:apply-templates/> </xsl:template> <xsl:template match="halle"> <xsl:apply-templates/> </xsl:template> <xsl:template match="stand"> <xsl:apply-templates/> </xsl:template> <xsl:template match="produkt"> <span> <xsl:attribute name="class">produkt</xsl:attribute> <xsl:apply-templates/> </span> </xsl:template> </xsl:stylesheet>