<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:variable name="YourNameSpace" select="'命名空间'"/>
  <xsl:variable name="YourAuthor" select="'作者'"/>
  <xsl:variable name="YourCreatDate" select="'创建日期'"/>
  <xsl:template match="/">
using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace <xsl:value-of select="$YourNameSpace"/>.Web
    {
    public partial class _Default : System.Web.UI.Page
    {
        <xsl:for-each select="MengmaCodeHelper/Server/Database/Table">
          <xsl:value-of select="$YourNameSpace"/>.BLL.<xsl:value-of select="@Class"/>BLL bll<xsl:value-of select="@Class"/> = new <xsl:value-of select="$YourNameSpace"/>.BLL.<xsl:value-of select="@Class"/>BLL();   
        </xsl:for-each>

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                <xsl:for-each select="MengmaCodeHelper/Server/Database/Table">
                  Bind<xsl:value-of select="@Class"/>();//<xsl:value-of select="@Caption"/></xsl:for-each> 
            }
        }
        <xsl:for-each select="MengmaCodeHelper/Server/Database/Table">
          /// &lt;summary&gt;
          /// 绑定<xsl:value-of select="@Caption"/>
          /// &lt;/summary&gt;
          public void Bind<xsl:value-of select="@Class"/>()
          {
            string strOrder = "<xsl:value-of select="@PrimaryKey"/> desc";  //排序条件
            DataSet ds = bll<xsl:value-of select="@Class"/>.GetList(6, "*", "", strOrder);
            //绑定数据源
            Rep<xsl:value-of select="@Class"/>.DataSource = (ds != null) ? ds.Tables[0] : null;
            Rep<xsl:value-of select="@Class"/>.DataBind();
          }  
        </xsl:for-each> 
    }
}
  </xsl:template>
</xsl:stylesheet>