<?xml version="1.0" ?> <!-- -*- sgml -*- -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- This is a sample XSL file that converts the bbdb-generated XML -->
<!-- file into html.  -->

<xsl:template match="/">

    <xsl:apply-templates/>

</xsl:template>

<xsl:template match="section">

  <xsl:variable name="secid">
    <xsl:value-of select="@initial"/>
  </xsl:variable>
  
  <a name="{$secid}"></a>
  <xsl:apply-templates/>

</xsl:template>

<xsl:template match="BBDB">

  <html>
    <body bgcolor="f0ffff">
    <title> B. Tech Class of '98 - Contact List </title>
    <font size="+1">
      CECRI B. Tech Class of '98 - Contact List
    </font>

    <p/>
    <center>
    <table width="90%" CELLPADDING="16" CELLSPACING="0" BORDER="1">
    <tr>
      <td bgcolor="fff8dc">
       <i>

          <font color="ff0000"> 

	  <font color="0000ff">Note:</font> The email addresses have
	  been modified a little to provide some protection from spam.
	  You should replace all "/@/" sequences with a simple "@"
	  before mailing.

	  <p/> <font color="0000ff">Note1 (Mon Jul 21 2003):</font>
	  Recently, all Madras telephone numbers have acquired a
	  leading 2, making them 8 digit numbers.  Not all numbers
	  below are updated to reflect this change.  </font>
	  
       </i>
      </td>
    </tr>
    </table>
    </center>

    <p/>
    Quick jump to first entry with this letter:
      <a href="#a">A </a>
      <a href="#b">B </a>
      <a href="#c">C </a>
      <a href="#d">D </a>
      <a href="#e">E </a>
      <a href="#f">F </a>
      <a href="#g">G </a>
      <a href="#h">H </a>
      <a href="#i">I </a>
      <a href="#j">J </a>
      <a href="#k">K </a>
      <a href="#l">L </a>
      <a href="#m">M </a>
      <a href="#n">N </a>
      <a href="#o">O </a>
      <a href="#p">P </a>
      <a href="#q">Q </a>
      <a href="#r">R </a>
      <a href="#s">S </a>
      <a href="#t">T </a>
      <a href="#u">U </a>
      <a href="#v">V </a>
      <a href="#w">W </a>
      <a href="#x">X </a>
      <a href="#y">Y </a>
      <a href="#z">Z </a>
    <p/>

    <table width="100%" CELLPADDING="1" CELLSPACING="0" BORDER="0">
    <tr>
      <td bgcolor="e0ffe3"> 

          <font color="ff0000"> Mon Sep 01 13:3:14 2005 </font>
          <img src="new_link.gif"/>

          Updates for Ayya, Madan, Chari, Raman, Thanga<br/>

          <font color="ff0000"> Wed Mar 09 17:11:14 2005 </font>
          <img src="new_link.gif"/>

          Updates for Ayya, Koorai, Muddle, Mulla, OGB, Ponns, Raman,
          and Sox.  Also <a href="wedding">check out </a>snaps from
          <b>Ponns' wedding</b>.  In particular, you may not want to miss
          out looking at <a href="wedding/ponns/r001-024.jpg">this
          snap</a>, the significance of which has been explained in
          the appropriate forum (or shall be done shortly, depending
          on when you read this).<br/>

          <font color="ff0000"> Tue Jul 20 11:53:56 2004
          </font>Updates for Ayya, Bals, Chandy, Chari, Goodhai, Gump,
          Koorai, Lsu, Muddle, OGB, OP, Perusu, Ponns, Raman, and
          Sox<br/>

          <font color="ff0000"> Thu Jul 24 15:07:30 2003:</font> <a
          href="wedding">Check out</a> the <b>wedding photos</b> from Bals,
          Lsu and Madan.

      </td>
    </tr>
    </table>
    
    <hr/>
    <xsl:apply-templates/>

    <p/>
    <center>
    <table width="90%" CELLPADDING="16" CELLSPACING="0" BORDER="1">
    <tr>
      <td bgcolor="fff8dc">
       <i>
          <a href="batch-list.html">This document</a> was generated by
          taking a <a
          href="http://www.cs.utah.edu/~karra/batch/bbdb.xml">raw XML
          file</a> containing all the info and <a
          href="http://www.cs.utah.edu/~karra/batch/README">applying</a>
          an <a
          href="http://www.cs.utah.edu/~karra/batch/batch-list.xsl">
          XSL transformation</a> on it.  The raw XML document itself
          was generated from <a
          href="http://www.cs.utah.edu/~karra">Karra</a>'s
          <a href="http://bbdb.sourceforge.net">BBDB</a> database
          using the <a
          href="http://www.cs.utah.edu/~karra/batch/bbdb-xml-print.el">
          bbdb-xml-print.el</a> package, which had to be hacked a
          little to work with <a
          href="http://bbdb.sourceforge.net/bbdb-2.32.tar.gz">recent
          BBDB versions</a>.  If you are interested in that <a
          href="http://www.gnu.org/manual/elisp-manual-21-2.8/elisp.html">
          elisp</a> program, chances are you would find <a
          href="http://www.cs.utah.edu/~karra/batch/bbdb.dtd">this
          dtd</a>, written by <a href="http://nwalsh.com">Norman
          Walsh</a>, useful as well.
	  
       </i>
      </td>
    </tr>

    </table>
    </center>

  </body>
  </html>

</xsl:template>

<xsl:template match="record">

  <font color="ff4500">
     <b><xsl:value-of select="name"/></b>
     <br/>
  </font>

  <!-- Match the regular BBDB fields first -->
  <xsl:apply-templates/>

  <hr/>
</xsl:template>

<xsl:template match="phones">
<!--  <font color="1e90ff">Phones:</font> -->
    <xsl:for-each select="phone">
      <font color="1e90ff"><xsl:value-of select="@location"/>: </font>
      <xsl:value-of select="."/>
      <xsl:if test="position()!=last()"><br/></xsl:if>
    </xsl:for-each>
    <br/>
</xsl:template>

<xsl:template match="address">
  <font color="1e90ff"><xsl:value-of select="@location"/>: </font>
  <xsl:for-each select="line">
      <xsl:value-of select="."/>, 
  </xsl:for-each>

  <xsl:variable name="city">
     <xsl:value-of select="city"/>
  </xsl:variable>

  <xsl:if test="$city!=''">
    <xsl:value-of select="$city"/>, 
  </xsl:if>

  <xsl:variable name="state">
     <xsl:value-of select="state"/>
  </xsl:variable>

  <xsl:if test="$state!=''">
    <xsl:value-of select="state"/>, 
  </xsl:if>

  <xsl:variable name="zip">
     <xsl:value-of select="zip"/>
  </xsl:variable>

  <xsl:if test="$zip!=''">  
    <xsl:value-of select="$zip"/>.
  </xsl:if>

  <xsl:if test="position()!=last()"><br/></xsl:if>
</xsl:template>

<xsl:template match="emails">
  <font color="1e90ff">Emails: </font>
  <xsl:apply-templates/>
  <br/>
</xsl:template>

<xsl:template match="email">
  <xsl:value-of select="."/>
  <xsl:if test="position()!=last()">, </xsl:if>
</xsl:template>

<!-- These empty templates are necessary... atleast with the XSL -->
<!-- engine in IE6.0... -->

<xsl:template match="company"/>
<xsl:template match="name"/>
<xsl:template match="note"/>

<xsl:template match="note">
  <xsl:for-each select=".">
   <xsl:choose>
     <xsl:when test="@type='d.o.b'">
       <font color="1e90ff">Birthdate</font>: <xsl:value-of select="."/>
<!--       <xsl:if test="position()!=last()"><br/></xsl:if> -->
       <br/>
     </xsl:when>
     
     <xsl:when test="@type='messenger'">
       <font color="1e90ff">Instant Messenger IDs: </font> 
       <xsl:value-of select="."/>
       <br/>
     </xsl:when>
     
     <xsl:when test="@type='timestamp'">
       <font color="1e90ff">Last Modified: </font> <xsl:value-of select="."/>
       <br/>
     </xsl:when>
     
     <xsl:when test="@type='www'">
     
       <font color="1e90ff">URL: </font>
       <xsl:variable name="url">
          <xsl:value-of select="."/>
       </xsl:variable>
       <a href="{$url}"><xsl:value-of select="$url"/></a>
       <br/>
     </xsl:when>
     
     <xsl:when test="@type='photo'">
       <font color="1e90ff">Photo: </font>
       <xsl:variable name="photo">
          <xsl:value-of select="."/>
       </xsl:variable>
       <a href="pics/{$photo}"><xsl:value-of select="$photo"/></a>
       <br/>
     </xsl:when>
 
<!--      <xsl:when test="position()=last()"> -->
<!--      <center> -->
<!--      <table width="99%" cellpadding="3" cellspacing="0" border="1"> -->
<!--      <tr bgcolor="e0ffff"> -->
<!--      <td> -->
<!--        <font color="ff0000"><i> -->
<!--            <xsl:value-of select="."/> -->
<!--        </i></font> -->
<!--      </td> -->
<!--      </tr> -->
<!--        <xsl:if test="position()!=last()"><br/></xsl:if>       -->
<!--      </table> -->
<!--      </center> -->
<!--      </xsl:when>   -->
     
   </xsl:choose>
   </xsl:for-each>
</xsl:template>

<xsl:template match="nots">
   <center>
      <table width="99%" cellpadding="3" cellspacing="1" border="1">
         <xsl:for-each select="not">
       <tr bgcolor="e0ffff">
	 <td>
             <font color="ff0000">
                <i><xsl:value-of select="."/></i>
             </font>
         </td></tr>
         </xsl:for-each>
      </table>
   </center>
</xsl:template>

</xsl:stylesheet>
