<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--

  Behavior.xsl - provides HTML formatting for behavior xml documents.

  Author:        Jim Fawcett
  Application:   Foundry Project, CSE784, Fall 2002

  Note:
    Please do not edit this file.  It is intended to provide a standard
    format for Foundry behavior descriptions.

  References to XSL tutorial material:
  1. www.zvon.org
  2. www.w3school.com
  2. Professional XML, Martin, et. al., Wrox, 2000.

-->
  <xsl:template match="/">
    <html>
      <head>
        <style>
          body { margin-left:10%; font-family:Tahoma; font-size:16px; }
          h1 { font-size: 24px; }
          h2 { font-size: 20px; }
          blockquote { margin-left: 2%; }
          .title { margin-left:-5%; margin-right: 0%; background-color:lightblue; }
          .section { color:maroon; background-color:#ddffff; }
        </style>
      </head>
      <body>
        <h1 class="title"><i>Foundry Process - </i>
          <xsl:value-of select="//@name"/>
        </h1>
        <xsl:value-of select="//process"/>

        <!-- 
          The following statements set up an anchor reference
          to the file specified in diagram.
        -->
        <p/>
        <xsl:element name="a">
          <xsl:attribute name="href">
            <xsl:value-of select="//diagram"/>
          </xsl:attribute>
        <xsl:value-of select="//@diagramTitle"/>
        diagram
        </xsl:element>
        <p/>
        <!-- end anchor statements -->
        <h2 class="section">Inputs:</h2>
        <ul>
          <xsl:for-each select="behavioral/inputs/input">
          <li>
            <b><xsl:value-of select="@variable" /></b>
            -
            <xsl:value-of select="def" />
            <blockquote>
            <xsl:value-of select="text" />
            </blockquote>
          </li>
          </xsl:for-each>
        </ul>

        <h2 class="section">Outputs:</h2>
        <ul>
          <xsl:for-each select="behavioral/outputs/output">
          <li>
            <b><xsl:value-of select="@variable" /></b>
            -
            <xsl:value-of select="def" />
            <blockquote>
            <xsl:value-of select="text" />
            </blockquote>
            Connects to:
            <!-- 
              The following statements set up an anchor reference
              to the file specified in connectsToFile.
            -->
            <xsl:element name="a">
              <xsl:attribute name="href">
                <xsl:value-of select="connectsToFile"/>
              </xsl:attribute>
            <xsl:value-of select="connectsToTitle"/>
            </xsl:element>
            <p/>
            <!-- end anchor statements -->
          </li>
          </xsl:for-each>
        </ul>
        <h2 class="section">Requirements:</h2>
        <ul>
          <xsl:for-each select="//test">
            <li>
              <b>Test
              <xsl:value-of select="@No" /></b>
              -
              <xsl:value-of select="def" />
              <blockquote>
              <xsl:for-each select="traces">
                traces to
                <xsl:value-of select="@to"/><br/>
              </xsl:for-each>
              <xsl:value-of select="text" />
              <xsl:for-each select="note">
                <br/><br/>Note:<br/>
                <xsl:value-of select="."/>
              </xsl:for-each>
              </blockquote>
            </li>
          </xsl:for-each>
        </ul>
        </body>
    </html>
  </xsl:template>
 </xsl:stylesheet>
