XSLT:

Beispiel:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

   <xsl:template match="/">
      <HTML>
         <HEAD>
	    <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></META>
               <TITLE>Guestbook</TITLE>
	 </HEAD>
         <BODY bgcolor="#CCCCCC" link="#CC0033" vlink="#CC0033" alink="#CC0033">
            <P>
               <xsl:apply-templates select="GUESTBOOK/EINTRAG" />
            </P>
            <H2><U>Neuer Eintrag</U></H2>
            <FORM action="http://10.0.0.20:8080/servlets/guestbook" method="post">
               <B>
                  <U>Name:</U>
                  <BR></BR>
                  <INPUT name="NAME" size="30"></INPUT><BR></BR>
                  <U>Email:</U><BR></BR>
                  <INPUT name="EMAIL" size="30"></INPUT><BR></BR>
                  <U>Comment:</U><BR></BR>
                  <TEXTAREA name="COMMENT" rows="10" cols="30"></TEXTAREA><BR></BR>
                  <INPUT type="submit" value="abschicken"></INPUT>
               </B>
            </FORM>
	 </BODY>
      </HTML>
   </xsl:template>

   <xsl:template match="GUESTBOOK/EINTRAG">
      <H2><U>Eintrag:</U></H2>
      <P>
         <B><U>Von:</U> <xsl:value-of select="NAME"/></B>
      </P>
      <P>
         <B><U>Datum:</U> <xsl:value-of select="@date"/></B>
      </P>
      <P>
         <B><U>Email:</U>
            <A>
               <xsl:attribute name="href">mailto:<xsl:value-of select="EMAIL"/></xsl:attribute>
               <xsl:value-of select="EMAIL"/>
            </A>
         </B>
      </P>
      <P>
         <B><U>Comment:</U><BR></BR>
            <xsl:value-of select="COMMENT"/>
         </B>
      </P>
      <HR></HR>
   </xsl:template>

</xsl:stylesheet>
   

Erläuterungen:


Autor:  andreas.schaufler@gmx.de

zurück zur Übersicht