> I expect to evolve this quickly and have the code ready for prime time by
> the O'Reilly Open Source conference in Monterey.

Here is the simple demo that I presented at that conference:

   <track name="PHP">

   <?

     $sessions = array(
       "10:45", "PHP 4 Internals", "Andi Gutmans",
       "1:30",  "State of PHP",    "Rasmus Lerdorf",
       "2:00",  "PHP and Java",    "Sam Ruby",
       "3:30",  "PHP and XML",     "Rael Dornfest"
     );

     $i = 0;
     while ($i < sizeof($sessions)) {
       echo "<session>\n";
       echo "  <time>" . $sessions[$i++] . "</time>\n";
       echo "  <title>" . $sessions[$i++] . "</title>\n";
       echo "  <speaker>" . $sessions[$i++] . "</speaker>\n";
       echo "</session>\n";
     }

   ?>

   </track>

With the following stylesheet:

   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
     <xsl:template match="track">
      <html>
       <head>
        <title><xsl:value-of select="@name"/> Track</title>
       </head>
       <body bgcolor="#ffffff">
        <h1>O'Reilly Conference Track for <xsl:value-of select="@name"/></h1>
        <table border="1">
         <tr BGCOLOR="#FFFF00">
          <th> Time </th>
          <th> Title </th>
          <th> Speaker </th>
         </tr>
         <xsl:apply-templates/>
        </table>
       </body>
      </html>
     </xsl:template>

     <xsl:template match="session">
      <tr BGCOLOR="#CCCCCC">
       <td align="right"> <xsl:value-of select="time"/> </td>
       <td> <xsl:value-of select="title"/> </td>
       <td> <xsl:value-of select="speaker"/> </td>
      </tr>
     </xsl:template>

   </xsl:stylesheet>

- Sam Ruby


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to