XML+XSLT+Servlet编程示例 --------陈开源(albertchen79@126.com)

原创 2006年06月05日 18:28:00

/*
 * <pre>
 * $Date: 2004-1-10
 * $Author: albertchen
 *
 * $Log:
 * </pre>
 */
package com.sunway.dcs.autocoding;

import com.dcs.util.DcsLoggerUtil;
import com.dcs.util.DcsResourceUtil;
import com.dcs.util.DcsSmartServlet;
import com.dcs.util.LogRecord;
import com.dcs.util.exception.InvalidParameterException;
import com.smart.AccessLogger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.util.Locale;


public class EditionCodingCaseList extends DcsSmartServlet {

    public void handleAccessLog(AccessLogger log,
                                HttpServletRequest request,
                                HttpServletResponse response) {
        DcsLoggerUtil.writeLog(LogRecord.OTHER_EVENT,
                               "define edition coding case",
                               log, request, response);
    }

    public void handleRequest(HttpServletRequest request,
                              HttpServletResponse response)
            throws Exception {
        response.setContentType(MIME_TYPE_XML);

        int codingId;
        try {
            codingId = Integer.parseInt(
                    request.getParameter("equal_coding_id"));
        } catch (NumberFormatException e) {
            throw new InvalidParameterException(
                    "invalid coding id : "
                    + request.getParameter("equal_coding_id"), e);
        }

        EditionCodingCaseDAO dao = new EditionCodingCaseDAO();
        Document doc = DocumentBuilderFactory.newInstance()
                .newDocumentBuilder().newDocument();
        Element root = doc.createElement("Informations");
        dao.getCaseList(codingId, root);

        // 指定样式表xsl.
        doc.appendChild(doc.createProcessingInstruction(
                "xml:stylesheet",
                "type=/"text/xsl/" href=/"EditionCodingCaseList.xsl/""));
        doc.appendChild(root);
        root.setAttribute("id", String.valueOf(codingId));
        root.setAttribute("url", request.getRequestURI());
        root.setAttribute("deltitle", "autocoding.editioncodingcase.deltitle");
        root.setAttribute("delmsg", "autocoding.editioncodingcase.delinfo");

        // 生成资源节点。
        Locale locale = (Locale) request.getSession().getAttribute(
                org.apache.struts.action.Action.LOCALE_KEY);
        root.appendChild(fetchXmlCommonResource(doc, locale));
        root.appendChild(fetchXmlResource(doc, locale));

        DOMSource doms = new DOMSource(doc);
        StreamResult sr = new StreamResult(response.getOutputStream());
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer t = tf.newTransformer();
        t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
        t.transform(doms, sr);
    }

    public boolean checkPermission(HttpServletRequest request,
                                   HttpServletResponse response) {
        // TODO 权限检查
        return true;
    }

    public Element fetchXmlResource(Document doc, Locale locale) {
        String[][] names = {
            {"title", "autocoding.editioncodingcase.listtitle"},
            {"type", "autocoding.editioncodingcase.type"},
            {"name", "autocoding.editioncodingcase.name"},
            {"value", "autocoding.editioncodingcase.value"},
            {"filetype", "autocoding.editioncodingcase.filetype"},
            {"controltype", "autocoding.editioncodingcase.controltype"},
            {"customer", "autocoding.editioncodingcase.customer"},
            {"vendor", "autocoding.editioncodingcase.vendor"},
            {"group", "autocoding.editioncodingcase.group"},
            {"property", "autocoding.editioncodingcase.property"}
        };

        return DcsResourceUtil.createDefaultResources(doc, locale, names);
    }

}

SubNormal.xsl

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <xsl:import href="NormalHeader.xsl"/>
 <xsl:import href="NormalFooter.xsl"/>
 <xsl:import href="NormalTurnPages.xsl"/>
 <xsl:import href="NormalHeaderFunction.xsl"/>
 
 <xsl:template name="html">
  <html>
   <xsl:call-template name="htmlhead">
    <xsl:with-param name="title"><xsl:value-of select="/Informations/resource/title"/></xsl:with-param>
    <xsl:with-param name="stylesheet">../script/iess.css</xsl:with-param>
                <xsl:with-param name="commonjs">../script/common.js</xsl:with-param>
   </xsl:call-template>
   <body leftmargin="4" topmargin="2" marginwidth="0" marginheight="0">
    <xsl:call-template name="headertable">
     <xsl:with-param name="title"><xsl:value-of select="/Informations/resource/title"/></xsl:with-param>
     <xsl:with-param name="imgroot">../images/</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="contenttable"/>
    <xsl:call-template name="footertable">
     <xsl:with-param name="imgroot">../images/</xsl:with-param>
    </xsl:call-template>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet>

 

NormalFooter.xsl

<?xml version="1.0" encoding="UTF-8"?>
<!--
 瀹氫箟浜嗗涓嬫ā鏉匡紝璇蜂娇鐢?<xsl:call-template name="...."/> 璋冪敤
 1. headertable
 澶撮儴鏍煎紡鐨勮〃鏍?
 闇€瑕侀鍏堝畾涔夋ā鏉?footfunction锛岃浣跨敤 <xsl:template name="...."/> 瀹氫箟
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <!--
  鍙傛暟 imgroot:  鍥剧墖鐩綍涔嬫墍鍦紝浠?"/" 缁撳熬锛屽 ../images/
  妯℃澘 footfunction: 瀹氬埗椤佃剼澶勭殑鍔熻兘鎸夐挳锛屽缈婚〉銆佹柊寤虹瓑锛屽彧闇€瑕佸祵鍏ュ苟鍒楃殑 <td></td> 瀵瑰氨濂姐€?
 -->
 <xsl:template name="footertable">
  <xsl:param name="imgroot"/>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td width="23">
     <img width="23" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>left-down-coner.gif</xsl:attribute>
     </img>
    </td>
    <xsl:call-template name="footfunction"/>
    <td width="100%">
     <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-gray-02.gif</xsl:attribute>
    </td>
    <td width="177">
     <img width="177" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>logo.gif</xsl:attribute>
     </img>
    </td>
    <td width="23">
     <img width="23" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>right-down-coner.gif</xsl:attribute>
     </img>
    </td>
   </tr>
  </table>
 </xsl:template>

</xsl:stylesheet>

NormalHeader.xsl

<?xml version="1.0" encoding="UTF-8"?>

<!--
 瀹氫箟浜嗗涓嬫ā鏉匡紝璇蜂娇鐢?<xsl:call-template name="...."/> 璋冪敤
 1. htmlhead
 HTML 椤甸潰鐨?<head>...</head> 閮ㄥ垎
 闇€瑕佷紶閫?title 鍜?stylesheet 涓や釜鍙傛暟
 2. headertable
 澶撮儴鏍煎紡鐨勮〃鏍?
 闇€瑕佽浼犻€?title 鍙傛暟
 闇€瑕侀鍏堝畾涔夋ā鏉?headfunction锛岃浣跨敤 <xsl:template name="...."/> 瀹氫箟
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <!--
  鍙傛暟 title:   <title>...</title> 涓棿鐨勬枃瀛?
  鍙傛暟 stylesheet:  浣跨敤鐨?CSS 鏂囦欢鍚?
 -->
 <xsl:template name="htmlhead">
  <xsl:param name="title"/>
  <xsl:param name="stylesheet"/>
       <xsl:param name="commonjs"/>
  <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
   <title><xsl:value-of select="$title"/></title>
   <script language="JavaScript">
                <xsl:attribute name="src"><xsl:value-of select="$commonjs"/></xsl:attribute>
   </script>
   <link rel="stylesheet" type="text/css">
    <xsl:attribute name="href"><xsl:value-of select="$stylesheet"/></xsl:attribute>
   </link>
  </head>
 </xsl:template>

 <!--
  鍙傛暟 title:   鏄剧ず褰撳墠椤甸潰鐨勬爣棰橈紝閫氬父鏄敱 XML 鏂囦欢鐨?Informationsresource/title 浼犻€掕繃鏉ョ殑
  鍙傛暟 imgroot:  鍥剧墖鐩綍涔嬫墍鍦紝浠?"/" 缁撳熬锛屽 ../images/
  妯℃澘 headfunction: 瀹炲湪琛ㄥご涓婄殑鍔熻兘锛屽鏋滄悳绱€佷繚瀛樼瓑鎸夐挳锛屾ā鎷熶腑鍙渶瑕佸畾涔夎嫢骞插苟鍒楃殑 <td></td> 瀵瑰嵆鍙?
 -->
 <xsl:template name="headertable">
  <xsl:param name="title"/>
  <xsl:param name="imgroot"/>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="ie">
   <tr>
    <td width="23">
     <img width="23" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>left-up-coner.gif</xsl:attribute>
     </img>
    </td>
    <td align="left" valign="middle" width="100%">
     <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-blue.gif</xsl:attribute>
     <font color="#FFFFFF"><xsl:value-of select="$title"/></font>
    </td>
    <td width="35">
     <img width="35" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>colorsection.gif</xsl:attribute>
     </img>
    </td>
    <xsl:call-template name="headfunction"/>
    <td width="23">
     <img width="23" height="30">
      <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>right-up-coner.gif</xsl:attribute>
     </img>
    </td>
   </tr>
  </table>
 </xsl:template>

</xsl:stylesheet>

 

NormalHeaderFunction.xsl

<?xml version="1.0" encoding="UTF-8"?>

<!--
 瀹氫箟浜嗗涓嬫ā鏉匡紝璇蜂娇鐢?<xsl:call-template name="...."/> 璋冪敤
 1. saveandclose
 淇濆瓨鍜屽叧闂紝閫氬父鐢ㄤ簬 .....Edit.xsl
 
 2. search
 鎼滅储锛岄€氬父鐢ㄤ簬 .......List.xsl
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <xsl:template name="jsfun">
        <xsl:param name="fields"/>
        <xsl:if test="$fields != ''">
            sform.<xsl:value-of select="substring-before($fields, ';')"/>.value = st;
            <xsl:call-template name="jsfun">
                <xsl:with-param name="fields" select="normalize-space(substring-after($fields, ';'))"/>
            </xsl:call-template>
        </xsl:if>
    </xsl:template>

    <xsl:template name="felement">
        <xsl:param name="fields"/>
        <xsl:if test="$fields != ''">
            <input type="hidden">
                <xsl:attribute name="name"><xsl:value-of select="substring-before($fields, ';')"/></xsl:attribute>
            </input>
            <xsl:call-template name="felement">
                <xsl:with-param name="fields" select="normalize-space(substring-after($fields, ';'))"/>
            </xsl:call-template>
        </xsl:if>
    </xsl:template>

    <xsl:template name="searchimpl">
        <xsl:param name="imgroot"/>
        <xsl:param name="condition"/>
        <xsl:param name="action"/>
        <script language="JavaScript">
            function beforeSearch(sform) {
                var st = '%' + sform.searchtext.value + '%';
                <xsl:call-template name="jsfun">
                    <xsl:with-param name="fields"><xsl:value-of select="$condition"/></xsl:with-param>
                </xsl:call-template>
            }
        </script>
        <form method="post" onSubmit="beforeSearch(this); return true;">
            <xsl:attribute name="action"><xsl:value-of select="$action"/></xsl:attribute>
            <input name="__conditiontype" type="hidden" value="or"/>
            <xsl:call-template name="felement">
                <xsl:with-param name="fields"><xsl:value-of select="$condition"/></xsl:with-param>
            </xsl:call-template>
            <td width="100" align="center" valign="middle">
                <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-gray.gif</xsl:attribute>
                <input type="textfield" class="input" name="searchtext"/>
            </td>
        </form>
        <td width="31">
            <img width="31" height="30" style="cursor:hand">
                <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>search.gif</xsl:attribute>
                <xsl:attribute name="alt"><xsl:value-of select="/Informations/common-resource/search"/></xsl:attribute>
                <xsl:attribute name="onClick">beforeSearch(document.forms[0]); document.forms[0].submit();</xsl:attribute>
            </img>
        </td>
    </xsl:template>

 <!--
  鍙傛暟 imgroot   鍥剧墖璧勬簮鏍圭洰褰曪紝浠?"/" 缁撳熬锛屽 ../images/
  鍙傛暟 condition   鎼滅储鏉′欢锛屽 like_code銆乪qual_id 绛? 澶氫釜鏉′欢鐢?; 鍙峰垎闅?
 -->
 <xsl:template name="search">
  <xsl:param name="imgroot"/>
  <xsl:param name="condition"/>
  <xsl:param name="action"/>
        <xsl:call-template name="searchimpl">
            <xsl:with-param name="imgroot" select="$imgroot"/>
            <xsl:with-param name="action" select="$action"/>
            <xsl:with-param name="condition"><xsl:choose>
                <xsl:when test="substring($condition, string-length($condition), 1) = ';'">
                        <xsl:value-of select="normalize-space($condition)"/>
                </xsl:when>
                <xsl:otherwise>
                        <xsl:value-of select="concat(normalize-space($condition), ';')"/>
                </xsl:otherwise>
            </xsl:choose></xsl:with-param>
        </xsl:call-template>
    </xsl:template>

 <!--
  鍙傛暟 imgroot   鍥剧墖璧勬簮鏍圭洰褰曪紝浠?"/" 缁撳熬锛屽 ../images/
 -->
 <xsl:template name="saveandclose">
  <xsl:param name="imgroot"/>
  <td>
   <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-gray.gif</xsl:attribute>
  </td>
        <xsl:call-template name="save_function">
            <xsl:with-param name="imgroot" select="$imgroot"/>
        </xsl:call-template>
        <xsl:call-template name="close_function">
            <xsl:with-param name="imgroot" select="$imgroot"/>
        </xsl:call-template>
 </xsl:template>

    <xsl:template name="save_function">
        <xsl:param name="imgroot"/>
        <td width="31">
            <img width="31" height="30" onclick="document.forms[0].submit()" style="cursor:hand">
                <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>save.gif</xsl:attribute>
                <xsl:attribute name="alt"><xsl:value-of select="/Informations/common-resource/save"/></xsl:attribute>
            </img>
        </td>
    </xsl:template>

    <xsl:template name="close_function">
        <xsl:param name="imgroot"/>
        <td width="31">
            <img alt="Close" width="31" height="30" onclick="window.close()" style="cursor:hand">
                <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>cancle.gif</xsl:attribute>
                <xsl:attribute name="alt"><xsl:value-of select="/Informations/common-resource/close"/></xsl:attribute>
            </img>
        </td>
    </xsl:template>
</xsl:stylesheet>

NormalTurnPages.xsl

<?xml version="1.0" encoding="UTF-8"?>
<!--
 瀹氫箟浜嗗涓嬫ā鏉匡紝璇蜂娇鐢?<xsl:call-template name="...."/> 璋冪敤
 1. turnpage
 缈婚〉鍔熻兘锛岃妯℃澘鍐呭寘鍚竴绯诲垪骞跺垪鐨?<td></td> 瀵?
 闇€瑕佷紶閫?title 鍜?stylesheet 涓や釜鍙傛暟
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <!--
  鍙傛暟 imgroot   鍥剧墖璧勬簮鏍圭洰褰曪紝浠?"/" 缁撳熬锛屽 ../images/
        璇存槑: 榛樿鎯呭喌涓嬬炕椤电瓑鎿嶄綔鍙紶閫?_page 鍙傛暟, 濡傛灉闇€瑕佷紶閫掑叾瀹冨弬鏁?
              璇风敓鎴愪互 & 寮€濮嬬殑鍙傛暟 URL 瀛楃涓? 淇濆瓨鍦?XML 婧愮殑
              /Informations/@moreparam 鑺傜偣涓?
 -->
 <xsl:template name="turnpages">
  <xsl:param name="imgroot"/>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=0<xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/firstpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>first.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="30">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@page - 1"/><xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/previouspage"/></xsl:attribute>
    <img width="30" height="30" border="0">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>pre.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@page + 1"/><xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/nextpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>next.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@pages"/><xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/lastpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>last.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td align="center">
   <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-gray-02.gif</xsl:attribute>
   <img border="0" height="0" width="100">
    <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>spacer.gif</xsl:attribute>
   </img><br/>
   绗?<xsl:value-of select="Informations/@page"/>  椤? 鍏?<xsl:value-of select="Informations/@pages"/> 椤?
  </td>
 </xsl:template>

 <xsl:template name="productturnpages">
  <xsl:param name="imgroot"/>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=0<xsl:value-of select="Informations/@moreparam"/>&amp;_pageCount=2</xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/firstpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>first.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="30">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@page - 1"/>&amp;_pageCount=2<xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/previouspage"/></xsl:attribute>
    <img width="30" height="30" border="0">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>pre.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@page + 1"/>&amp;_pageCount=2<xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/nextpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>next.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td width="31">
   <a>
    <xsl:attribute name="href"><xsl:value-of select="Informations/@url"/>?_page=<xsl:value-of select="Informations/@pages"/>&amp;_pageCount=2<xsl:value-of select="Informations/@moreparam"/></xsl:attribute>
    <xsl:attribute name="title"><xsl:value-of select="Informations/common-resource/lastpage"/></xsl:attribute>
    <img width="31" height="30" border="0" style="cursor:hand">
     <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>last.gif</xsl:attribute>
    </img>
   </a>
  </td>
  <td align="center">
   <xsl:attribute name="background"><xsl:value-of select="$imgroot"/>bg-gray-02.gif</xsl:attribute>
   <img border="0" height="0" width="100">
    <xsl:attribute name="src"><xsl:value-of select="$imgroot"/>spacer.gif</xsl:attribute>
   </img><br/>
   绗?<xsl:value-of select="Informations/@page"/>  椤? 鍏?<xsl:value-of select="Informations/@pages"/> 椤?
  </td>
 </xsl:template>

 

</xsl:stylesheet>

 

AccepterDepartmentFileIssueList.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <xsl:import href="../SubNormal.xsl"/>
 <xsl:template match="/">
  <xsl:call-template name="html"/>
 </xsl:template>
 <xsl:template name="headfunction">
  <form method="post" onsubmit="return this.equal_type.value;">
   <xsl:attribute name="action">AccepterDepartmentFileIssueList?_session=&amp;equal_accepter_id=<xsl:value-of select="/Informations/user/userid"/>&amp;</xsl:attribute>
   <td width="100" align="center" valign="middle" background="../images/bg-gray.gif">
    <input name="equal_type" type="text" class="input"/>
   </td>
  </form>
  <td width="31">
   <img src="../images/search.gif" width="31" height="30" onclick="document.forms[0].submit()" style="cursor:hand"/>
  </td>
 </xsl:template>
 <xsl:template name="footfunction">
  <xsl:call-template name="turnpages">
   <xsl:with-param name="imgroot">../images/</xsl:with-param>
  </xsl:call-template>
 </xsl:template>
 <xsl:template name="contenttable">
  <script language="JavaScript">
            function doDelete(tid) {
                var url = '../DcsIframe?_title=<xsl:value-of select="/Informations/@deltitle"/>&amp;_iframe='
                    + escape('util/dialog/ConfirmDialog?_title=')
                    + '<xsl:value-of select="/Informations/@deltitle"/>'
                    + escape('&amp;_msg=') + '<xsl:value-of select="/Informations/@delinfo"/>'
                    + escape('&amp;_okurl=' + escape('../../basic/DepartmentFileIssueDelete?equal_id='))
                    + tid;
                if (showModalDialog(url, '', 'scroll:no;center:yes;dialogWidth:480px;dialogHeight:320px') == 'true') location.reload();
            }

            function doUpload(tid) {
                var url = 'basic/DepartmentFileIssueSelect?equal_id=' + tid;
                if (showModalDialog('../DcsIframe?_iframe=' + escape(url), '', 'scroll:no;center:yes;dialogWidth:480px;dialogHeight:320px') == 'true') location.reload();
            }
        </script>
  <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#676767" class="ie">
   <tr align="left" bgcolor="#EEEEEE" class="td">
    <td width="4%">
    搴忓彿
           </td>
    <td width="6%">
     <center>
      <xsl:value-of select="Informations/resource/file_level"/>
     </center>
    </td>
    <td width="6%">
     <center>
      <xsl:value-of select="Informations/resource/type"/>
     </center>
    </td>
    <td width="6%">
     <center>
      <xsl:value-of select="Informations/resource/username"/>
     </center>
    </td> 
    <td width="14%">
     <center>
      <xsl:value-of select="Informations/resource/times"/>
     </center>
    </td>
    <td width="14%">
     <center>
      <xsl:value-of select="Informations/resource/slave"/>
     </center>
    </td>
    <td width="8%"> </td>
   </tr>
   <script language="javascript">
    function onTRMouseOvered(obj)
    {
     obj.bgColor="#E0E9FE";
    }
    
    function onTRMouseOuted(obj)
    {
     obj.bgColor="#FFFFFF";
    }
   </script>
   <xsl:for-each select="Informations/rec">
    <tr align="left" bgcolor="#FFFFFF" style="cursor: hand;" onmouseover="onTRMouseOvered(this);" onmouseout="onTRMouseOuted(this);">
     <td>
        <center>
      <xsl:value-of select="//Informations/@page * //Informations/@pagecount+position()-16"> </xsl:value-of>
      </center>
     </td>
     <td>
        <center>
      <xsl:choose>
       <xsl:when test="file_level='1'">
         鏅€氭枃浠?
        </xsl:when>
       <xsl:when test="file_level='2'">
         绱ф€ユ枃浠?
        </xsl:when>
      </xsl:choose>
      </center>
     </td>
     <td>
          <center> 
      <xsl:value-of select="type"/>
      </center>
     </td>
     <td>
        <center>
      <xsl:value-of select="username"/>
      </center>
     </td>         
     <td>
        <center>
      <xsl:value-of select="times"/>
      </center>
     </td>
     <td>
        <center>
      <xsl:if test="template='T'">
       <a style="cursor:hand">
        <font color="#0000FF">
         <xsl:attribute name="onclick">javascript: window.open("DepartmentFileIssueDownload?equal_id=<xsl:value-of select="id"/>","","scrollbars=yes,left=100px,top=100px,width=500px,height=350px,resizable=yes,status=no,menubar=yes")</xsl:attribute>
         <xsl:value-of select="filename"/>
        </font>
       </a>
      </xsl:if>
      </center>
     </td>
     <td>
        <center>
      <a style="width:20%">
       <xsl:attribute name="title"><xsl:value-of select="/Informations/common-resource/edit"/></xsl:attribute>
       <xsl:attribute name="onclick">modalDialog1('./DepartmentFileIssueEdit?_temp=&amp;equal_id=<xsl:value-of select="id"/>')</xsl:attribute>
       <img src="../images/view.gif" width="16" height="16" border="0" style="cursor:hand"/>
      </a>
      <a style="width:20%">
         <xsl:choose>
           <xsl:when test="state!=''">
        </xsl:when>
          <xsl:when test="state=''">
       <xsl:attribute name="onclick">modalDialog1('./DepartmentFileIssueApprove?_temp=&amp;equal_id=<xsl:value-of select="id"/>')</xsl:attribute>
       <img src="../images/changingapply.gif" width="16" height="16" border="0" style="cursor:hand"/>
        </xsl:when>
          </xsl:choose>      
      </a>   
      <a style="width:20%">
       <xsl:attribute name="title">褰掓。</xsl:attribute>
       <xsl:attribute name="onclick"/>
       <img src="../images/attached.gif" width="16" height="16" border="0" style="cursor:hand"/>
      </a>        
      <a style="width:20%">
       <xsl:attribute name="title"></xsl:attribute>
       <xsl:attribute name="onclick"/>
       <img src="../images/workflow.gif" width="16" height="16" border="0" style="cursor:hand"/>
      </a>
      </center>
     </td>
    </tr>
   </xsl:for-each>
  </table>
 </xsl:template>
</xsl:stylesheet>


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Linux系统编程:用PHP执行Root命令 转自:http://blog.163.com/sunzs20113@126/blog/static/3706880920106205435336/

转自:http://blog.163.com/sunzs20113@126/blog/static/3706880920106205435336/ 在玩C以前玩过一段时间的PHP, ...

简单示例Servlet中XML文件配置方法

在myEclipse中,一个web项目的文件目录结构【注意标号为123的文件】:  标号①②③文件中的内容: ①Java文件,里面有处理get请求的doGet函...

SlickEdit使用技巧(转载:http://blog.163.com/chenzhishan00@126/blog/static/38899843201041422939297/)

. SlickEdit 设置:   字体:Tools->Options->Font个人觉得最好看的是FixedSys。显示改动过的行标记:Tools->Options->File Extension ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)