<?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.w3.org
  3. Professional XML, Martin, et. al., Wrox, 2000.

  ***********************************************************************
  Additional Note: This code has been modified by the Software Tools team
                   of CSE784, Software Studio - Last Update: 10/27/02
                   Ozer Ozkaraoglu,
                   Aykut Sahin.
  Changes made by the team: * Adding multiple diagrams is supported.
  
				   Last Update - 12/01/2002
				   Shanmuganathan Sivaraj - ssivaraj@syr.edu
				   Code has been added for viewing the sibling tag based on the 
				   visibility attribute of the node.

-->
  <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.
          10/27/02: Now XSL can support multiple diagrams - Build team
        -->
        <p/>
        <xsl:for-each select="behavioral/diagram">
          <li>
	  <xsl:element name="a">
          <xsl:attribute name="href">
            <xsl:value-of select="text()" />
          </xsl:attribute>
          <xsl:value-of select="@diagramTitle"/>
          diagram
          </xsl:element>
          </li>
        </xsl:for-each>
        <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:value-of select="text" />
              </blockquote>
            </li>
          </xsl:for-each>
        </ul>
        <!--
        The Following code is for viewing the Sibling data based on the visibility
        tag of the node. 
        Code added by Shanmuganthan Sivaraj- ssivaraj@syr.edu - 12/01/2002
        -->
        <xsl:for-each select="behavioral/sibling">
		<xsl:if test="@visible='true'">
        <h2 class="section">Sibling:</h2>
        <ul>
				<li>
					<b>Ref</b> - 
					<xsl:element name="a">
						<xsl:attribute name="href">
							<xsl:value-of select="@ref" />
						</xsl:attribute>
					<xsl:value-of select="@ref" />
					</xsl:element>
				</li>
				<li>
					<b>Manifest</b> - 
					<xsl:element name="a">
						<xsl:attribute name="href">
							<xsl:value-of select="@manifest" />
						</xsl:attribute>
					<xsl:value-of select="@manifest" />
					</xsl:element>
				</li>
        </ul>
		</xsl:if>
		</xsl:for-each>
    
        </body>
    </html>
  </xsl:template>
 </xsl:stylesheet>
