<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:import href="commonfun.xsl"/>
  <xsl:variable name="YourNameSpace" select="'命名空间'"/>
  <xsl:variable name="YourTableName" select="'表格名称'"/>
  <xsl:variable name="YourClassName" select="'表格类名'"/>
  <xsl:variable name="YourFieldFristKey" select="'主键字段名'"/>
  <xsl:variable name="YourFristKey" select="'主键属性名'"/>
  <xsl:variable name="YourFieldFristTitle" select="'标题字段名(默认以第一个文本字段作为标题列和搜索列)'"/>
  <xsl:variable name="YourAuthor" select="'作者'"/>
  <xsl:variable name="YourCreatDate" select="'创建日期'"/>
  <xsl:template match="/">

  &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="<xsl:value-of select="$YourClassName"/>Form.aspx.cs" Inherits="<xsl:value-of select="$YourNameSpace"/>.Web.Admin.<xsl:value-of select="$YourClassName"/>Form" %&gt;
  <xsl:text disable-output-escaping="yes"><![CDATA[  
<%@ Register src="Contrl/Footer.ascx" tagname="Footer" tagprefix="uc1" %>
<%@ Register src="Contrl/Header.ascx" tagname="Header" tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
        body
        {
            font-size: 12px;
        }
</style>
</head>
<body>
    <form id="form1" runat="server">
     <uc2:Header ID="Header1" runat="server" />
    <div>
    <br />    
    <!--标准工具栏 -->
     <div style="width: 100%; border-bottom:1px solid #cdcdcd;margin-top:5px;">   
            <div style="margin-left:80px;">                           
                <input type="button" value="新建" style="display:none;" />          
                <asp:Button ID="btnSubmit" runat="server" Text="保存" onclick="btnSave_Click" ></asp:Button>            
                <input type="button" value="删除" style="display:none;"/>
				]]></xsl:text>
                &lt;input type="button" value="返回" onclick="window.location.href='<xsl:value-of select="$YourClassName"/>List.aspx'" /&gt;
				<xsl:text disable-output-escaping="yes"><![CDATA[  
                <asp:HiddenField ID="AccessStateHidden" runat="server" />
            </div>                        
     </div> 
    <table cellSpacing="0" cellPadding="0" width="100%" border="0">
 ]]></xsl:text>     
       <xsl:for-each select="MengmaCodeHelper/Server/Database/Table[@Name=$YourTableName]/Column">
         &lt;tr&gt;
           <td  align="right" style="width:150px;"><xsl:value-of select="@Caption"/>：</td>
         &lt;td width="*" align="left"&gt;
           <xsl:variable name="Datatype" select="@Datatype"/>			  
			     <xsl:variable name="groupid" select="/MengmaCodeHelper/DataTypeMapping/DataTypes/Item[@name=$Datatype]/@groupid"/>			  
			     <xsl:variable name="CtrlInfo" select="/MengmaCodeHelper/DataTypeMapping/Mapping/Group[@groupid=$groupid]/DataType/@Ctrl_Layout1"/> 
			     <xsl:call-template name="string-replace-all">
			     <xsl:with-param name="text" select="$CtrlInfo"/>
			     <xsl:with-param name="replace" select="'{0}'"/>
			     <xsl:with-param name="by" select="@Property"/>
			     </xsl:call-template>		     
         &lt;/td&gt;
        &lt;/tr&gt;   
       </xsl:for-each>      
    <xsl:text disable-output-escaping="yes"><![CDATA[  
    </table>
    <uc1:Footer ID="Footer1" runat="server" />   
    </form>
</body>
</html>
 ]]></xsl:text>
  </xsl:template>
</xsl:stylesheet>