<?xml version='1.0' encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" />
<xsl:template match="root">
<html>
<head>
<title><xsl:value-of select="param[@id='HTMLTITLE']" /></title>
<xsl:apply-templates select="reload" />
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
   
   <xsl:attribute name="lang">zh</xsl:attribute>

   <center>
   <xsl:apply-templates select="urls" />
   <xsl:apply-templates select="inputs" />   
   <table border="0" cellspacing="0" cellpadding="0">
      <xsl:if test="param[@id='HTML.WIDTH']">   
      	<xsl:attribute name="width"><xsl:value-of select="param[@id='HTML.WIDTH']" /></xsl:attribute>
      </xsl:if>   
      <tr>
         <td>
   	    <xsl:apply-templates select="webchart" />
	 </td>
      </tr>
   </table>
   </center>

</body>
</html>
</xsl:template>

<xsl:template match="reload" >
    <script language="JavaScript">
        window.timer=window.setTimeout('window.location.href="<xsl:value-of select="." />";',<xsl:value-of select="@time" /> * 1000);
    </script>
</xsl:template>

<xsl:template match="urls" >
    <div>
    <xsl:for-each select="url">
	<xsl:choose>
	    <xsl:when test="@id = '-' or @sep">   
	    	<xsl:value-of select="." disable-output-escaping="yes" />
	    </xsl:when>
	    <xsl:otherwise>   
	    	<a>
	    		<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
	    		<xsl:value-of select="@id" />
	    	</a>
	    </xsl:otherwise>
	</xsl:choose>
    </xsl:for-each>
    </div>
</xsl:template>

<xsl:template match="inputs" >
    <div>
    <form method="POST">
    <xsl:attribute name="action"><xsl:value-of select="//param[@id='REQUEST.FILE']" /></xsl:attribute>
    <xsl:for-each select="item">
    	<xsl:if test="@label">
    		<xsl:value-of select="@label" />
    	</xsl:if>
    	<input>
    		<xsl:attribute name="type"><xsl:value-of select="@type" /></xsl:attribute>
    		<xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
    		<xsl:attribute name="value"><xsl:value-of select="@value" /></xsl:attribute>
    		<xsl:if test="@size">
    			<xsl:attribute name="size"><xsl:value-of select="@size" /></xsl:attribute>
    		</xsl:if>
    	</input>
    </xsl:for-each>
    <input type="submit" value="Query" />
    </form>
    </div>
</xsl:template>

<xsl:template match="webchart" >
   <xsl:apply-templates select="image" />
</xsl:template>

<xsl:template match="image">
   <div style="float:left;">
   <img border="0" align="center" vspace="0">
	<xsl:attribute name="src">
		<xsl:value-of select="file" />
	</xsl:attribute>
	<xsl:attribute name="usemap">#<xsl:value-of select="image_map/@name" /></xsl:attribute> 
   </img>
   <xsl:for-each select="image_map">
      <map>
	<xsl:attribute name="name">
		<xsl:value-of select="@name" />
        </xsl:attribute>
	<xsl:for-each select="mapitem">
	   <area>
	      <xsl:attribute name="title"><xsl:value-of select="title" /></xsl:attribute>
	      <xsl:attribute name="shape"><xsl:value-of select="shape" /></xsl:attribute>
	      <xsl:attribute name="coords"><xsl:value-of select="coords" /></xsl:attribute>
	      <xsl:attribute name="href"><xsl:value-of select="href" /></xsl:attribute>
	  </area>
	</xsl:for-each>
      </map>
    </xsl:for-each>
    </div>
</xsl:template>

</xsl:stylesheet>