- 浏览: 73594 次
- 性别:
- 来自: 西安
文章分类
最新评论
XSL 语言入门5 -- xsl实际项目应用示例2
道理和上一篇文章一样:
http://blog.csdn.net/hu_shengyang/article/details/8726579
xml文档MAP_HISTORY_NPATROL_Edit.xml:
<?xml version="1.0" encoding="GBK"?> <?xml-stylesheet type="text/xsl" href="MAP_HISTORY_NPATROL_Edit.xsl"?> <columns table="MAP_HISTORY_NPATROL" isWorkOrder="true" flowID="D0000000018" flowName="计划巡维单流程" actionName="填单" title="新计划巡维工单编辑" token="607A7545-6F56-E0E0-6A7F-855B733E5524"> <column seqId="000" feildName="JHXWGUID" feildTitle="GUID" feildType="VARCHAR2" feildLen1="40" feildLen2="" feildNull="false" feildKey="true" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="false" readOnly="true" align="right" rule="Guid" when="before"> </column> <column seqId="044" feildName="ROOTID" feildTitle="ROOTID" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="false" readOnly="true" align="left" rule="FlowInstID" when="before"> </column> <column seqId="001" feildName="JHXWGDH" feildTitle="计划巡维工单号" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="JHXWGDH" when="before"> </column> <column seqId="002" feildName="TXR" feildTitle="填写人" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="R" visible="true" readOnly="false" align="center" rule="UserTitle" when="before"> </column> <column seqId="003" feildName="TXRDW" feildTitle="填写人单位" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="R" visible="true" readOnly="false" align="center" rule="DeptName" when="before"> </column> <column seqId="004" feildName="TXSJ" feildTitle="填写时间" feildType="DATE" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="005" feildName="TXRLXDH" feildTitle="填写人联系电话" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="006" feildName="SDR" feildTitle="收单人" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="007" feildName="SDRDW" feildTitle="收单人单位" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="008" feildName="SDRLXDH" feildTitle="收单人联系电话" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="009" feildName="SDSJ" feildTitle="收单时间" feildType="DATE" feildLen1="10" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="W" visible="true" readOnly="false" align="left" rule="" when=""> </column> <column seqId="010" feildName="KHHH" feildTitle="客户户号" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="011" feildName="KHDZ" feildTitle="客户地址" feildType="VARCHAR2" feildLen1="100" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="012" feildName="SSFJ" feildTitle="所属分局" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="013" feildName="SSXL" feildTitle="所属线路" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="014" feildName="ZDZCH" feildTitle="终端资产号" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="015" feildName="LJDZ" feildTitle="逻辑地址" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="016" feildName="ZDLX" feildTitle="终端类型" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="017" feildName="ZDCJ" feildTitle="终端厂家" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="018" feildName="SIMKH" feildTitle="SIM卡号" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="019" feildName="DBZCH" feildTitle="电表资产号" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="020" feildName="DBCJ" feildTitle="电表厂家" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="021" feildName="DBDZ" feildTitle="电表地址" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="022" feildName="CTBB" feildTitle="CT变比" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="023" feildName="PTBB" feildTitle="PT变比" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="024" feildName="BYQRL" feildTitle="变压器容量" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="025" feildName="BMDS" feildTitle="终端ID" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="026" feildName="YGZ" feildTitle="有功总" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="027" feildName="YGP" feildTitle="有功平" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="028" feildName="YGF" feildTitle="有功峰" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="029" feildName="YGG" feildTitle="有功谷" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="030" feildName="GZNR" feildTitle="工作内容" feildType="VARCHAR2" feildLen1="100" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="031" feildName="SPR" feildTitle="审批人" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="032" feildName="SPDW" feildTitle="审批单位" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="033" feildName="SPSJ" feildTitle="审批时间" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="034" feildName="SPYJ" feildTitle="审批意见" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="035" feildName="DYQXGDH" feildTitle="对应抢修工单号" feildType="VARCHAR2" feildLen1="30" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="036" feildName="CLR" feildTitle="处理人" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="037" feildName="CLRDW" feildTitle="处理人单位" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="038" feildName="CLSJ" feildTitle="处理时间" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="039" feildName="YSR" feildTitle="验收人" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="040" feildName="YSRDW" feildTitle="验收人单位" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="041" feildName="YSSJ" feildTitle="验收时间" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="042" feildName="YSYJ" feildTitle="验收意见" feildType="VARCHAR2" feildLen1="100" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="043" feildName="FLAG" feildTitle="FLAG" feildType="VARCHAR2" feildLen1="20" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="FlowFlag" when="before"> </column> <column seqId="045" feildName="KHMC" feildTitle="客户名称" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="046" feildName="CLJG" feildTitle="处理结果" feildType="VARCHAR2" feildLen1="100" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="047" feildName="FXYGZ" feildTitle="反向有功总" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="048" feildName="FXYGF" feildTitle="反向有功峰" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="049" feildName="FXYGP" feildTitle="反向有功平" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> <column seqId="050" feildName="FXYGG" feildTitle="反向有功谷" feildType="VARCHAR2" feildLen1="50" feildLen2="" feildNull="true" feildKey="false" defaultValue="" feildDescribe="" feildProperty="" feildValue="" feildRight="" visible="true" readOnly="true" align="left" rule="" when=""> </column> </columns>
<?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:template match="/"> <html> <head> <link rel="stylesheet" type="text/css" href="css/public.css"/> <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"/> <style type="text/css"> input{ width:100%; } </style> </head> <body> <!-- <div> <xsl:value-of select="columns/attribute::title"/> </div> --> <table style="width:800;" width="100%"> <!-- 隐藏行中包括table、isWorkOrder、flowID、flowName、actionName、token等信息 --> <tr id="hiddenTr" style="display:none;" width="100%"> <!-- display:none; --> <!-- 字段 table --> <td width="17%"> <xsl:attribute name="id">table</xsl:attribute> <xsl:attribute name="name">table</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::table"/></xsl:attribute> <xsl:value-of select="columns/attribute::table"/> </td> <!-- 字段 isWorkOrder --> <td width="17%"> <xsl:attribute name="id">isWorkOrder</xsl:attribute> <xsl:attribute name="name">isWorkOrder</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::isWorkOrder"/></xsl:attribute> <xsl:value-of select="columns/attribute::isWorkOrder"/> </td> <!-- 字段 flowID --> <td width="17%"> <xsl:attribute name="id">flowID</xsl:attribute> <xsl:attribute name="name">flowID</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::flowID"/></xsl:attribute> <xsl:value-of select="columns/attribute::flowID"/> </td> <!-- 字段 flowName --> <td width="17%"> <xsl:attribute name="id">flowName</xsl:attribute> <xsl:attribute name="name">flowName</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::flowName"/></xsl:attribute> <xsl:value-of select="columns/attribute::flowName"/> </td> <!-- 字段 actionName --> <td width="16%"> <xsl:attribute name="id">actionName</xsl:attribute> <xsl:attribute name="name">actionName</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::actionName"/></xsl:attribute> <xsl:value-of select="columns/attribute::actionName"/> </td> <!-- 字段 token --> <td width="16%"> <xsl:attribute name="id">token</xsl:attribute> <xsl:attribute name="name">token</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="columns/attribute::token"/></xsl:attribute> <xsl:value-of select="columns/attribute::token"/> </td> </tr> <!-- 要在页面中显示的字段 --> <xsl:variable name="tdStyle"/> <!-- 定义变量tdStyle --> <tr> <xsl:for-each select="columns/column"> <!-- 此列只有此一个字段,所以隐藏改行;若有>1个字段,则不需隐藏此行 --> <xsl:attribute name="style"> <xsl:if test="./@visible='false'">display:none;</xsl:if> </xsl:attribute> <!-- 字段 JHXWGUID --> <xsl:if test="./@feildName='JHXWGUID'"> <td width="18%"> <xsl:attribute name="align"><xsl:value-of select="./@align"/></xsl:attribute> <!-- 判断是否隐藏此列 --> <xsl:attribute name="style"> <xsl:if test="./@visible='false'">display:none;</xsl:if> </xsl:attribute> <xsl:value-of select="./@feildTitle"/> <xsl:if test="./@feildKey='true'"> <span style="color:#E58A22;font-weight:bold;font-size:15px;">(PK)</span> </xsl:if> </td> <td colspan="2" width="32%"> <xsl:choose> <xsl:when test="./child::*"> <!-- select --> <xsl:if test="./feildDef/options/option"> <select> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <xsl:for-each select="./feildDef/options/option"> <option> <xsl:value-of select="./@value"/> </option> </xsl:for-each> </select> </xsl:if> </xsl:when> <xsl:otherwise> <!-- input --> <xsl:if test="./@feildLen1 < 100"> <input width="100%"> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- type 属性 --> <xsl:attribute name="type">text</xsl:attribute> <!-- maxLength 属性 --> <xsl:attribute name="maxLength"><xsl:if test="./@feildLen2 = ''"><xsl:value-of select="./@feildLen1"/></xsl:if></xsl:attribute> <!-- 时间下拉框样式 属性 --> <xsl:if test="./@feildType = 'TIMESTAMP'"> <xsl:attribute name="onfocus">WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})</xsl:attribute> <xsl:attribute name="class">Wdate</xsl:attribute> </xsl:if> <xsl:if test="./@feildType = 'DATE'"> <xsl:attribute name="onfocus">WdatePicker({dateFmt:'yyyy-MM-dd'})</xsl:attribute> <xsl:attribute name="class">Wdate</xsl:attribute> </xsl:if> <!-- style 属性 --> <xsl:attribute name="style"> <xsl:if test="./@when != ''">when:<xsl:value-of select="./@when"></xsl:value-of>;</xsl:if> <xsl:if test="./@rule != ''">rule:<xsl:value-of select="./@rule"></xsl:value-of>;</xsl:if> <xsl:if test="./@feildKey='true'">pk:true;</xsl:if> <xsl:if test="./@feildLen2 != ''"> length:<xsl:value-of select="./@feildLen1"/>-<xsl:value-of select="./@feildLen2"/>; </xsl:if> <!-- visible 属性 --> <xsl:if test="./@visible = 'false'"> <xsl:text>display:none;</xsl:text> </xsl:if> <!-- 是否是工单 --> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"> <xsl:text>border-style:none;</xsl:text> </xsl:if> <xsl:if test="./@feildRight = 'R'"> <xsl:text>border-color:red;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"> <xsl:text>border-style:none;</xsl:text> </xsl:if> <xsl:if test="./@feildNull = 'false'"> <xsl:text>border-color:red;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="./@feildType = 'NUMBER'"> <xsl:text>dataType:NUMBER;</xsl:text> </xsl:if> <xsl:if test="./@feildType = 'VARCHAR2' or ./@feildType = 'VARCHAR'"> <xsl:text>dataType:STRING;</xsl:text> </xsl:if> <!-- 时间下拉框样式 属性 --> <xsl:if test="./@feildType = 'TIMESTAMP'"> <xsl:text>dataType:TIMESTAMP;</xsl:text> </xsl:if> <xsl:if test="./@feildType = 'DATE'"> <xsl:text>dataType:DATE;</xsl:text> </xsl:if> </xsl:attribute> <!-- readonly 属性 --> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"> <xsl:attribute name="readonly">true</xsl:attribute> </xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"> <xsl:attribute name="readonly">true</xsl:attribute> </xsl:if> </xsl:if> <!-- value 属性 --> <xsl:attribute name="value"><xsl:value-of select="./@feildValue"/></xsl:attribute> </input> </xsl:if> <!-- textarea --> <xsl:if test="./@feildLen1 >= 100"> <textarea rows="3" cols="28"> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- text --> <xsl:value-of select="./@feildValue"/> <!-- readonly 属性 --> <xsl:attribute name="readonly"> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"><xsl:text>readonly</xsl:text></xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"><xsl:text>readonly</xsl:text></xsl:if> </xsl:if> </xsl:attribute> </textarea> </xsl:if> </xsl:otherwise> </xsl:choose> </td> </xsl:if> <!-- 字段 ROOTID--> <xsl:if test="./@feildName='ROOTID'"> <td width="18%"> <xsl:attribute name="align"><xsl:value-of select="./@align"/></xsl:attribute> <!-- 判断是否隐藏此列 --> <xsl:attribute name="style"> <xsl:if test="./@visible='false'">display:none;</xsl:if> </xsl:attribute> <xsl:value-of select="./@feildTitle"/> <xsl:if test="./@feildKey='true'"> <span style="color:#E58A22;font-weight:bold;font-size:15px;">(PK)</span> </xsl:if> </td> <td colspan="2" width="32%"> <xsl:choose> <xsl:when test="./child::*"> <!-- select --> <xsl:if test="./feildDef/options/option"> <select> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <xsl:for-each select="./feildDef/options/option"> <option> <xsl:value-of select="./@value"/> </option> </xsl:for-each> </select> </xsl:if> </xsl:when> <xsl:otherwise> <!-- input --> <xsl:if test="./@feildLen1 < 100"> <input width="100%"> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- type 属性 --> <xsl:attribute name="type">text</xsl:attribute> <!-- maxLength 属性 --> <xsl:attribute name="maxLength"><xsl:if test="./@feildLen2 = ''"><xsl:value-of select="./@feildLen1"/></xsl:if></xsl:attribute> <!-- 时间下拉框样式 属性 --> <xsl:if test="./@feildType = 'TIMESTAMP'"> <xsl:attribute name="onfocus">WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})</xsl:attribute> <xsl:attribute name="class">Wdate</xsl:attribute> </xsl:if> <xsl:if test="./@feildType = 'DATE'"> <xsl:attribute name="onfocus">WdatePicker({dateFmt:'yyyy-MM-dd'})</xsl:attribute> <xsl:attribute name="class">Wdate</xsl:attribute> </xsl:if> <!-- style 属性 --> <xsl:attribute name="style"> <xsl:if test="./@when != ''">when:<xsl:value-of select="./@when"></xsl:value-of>;</xsl:if> <xsl:if test="./@rule != ''">rule:<xsl:value-of select="./@rule"></xsl:value-of>;</xsl:if> <xsl:if test="./@feildKey='true'">pk:true;</xsl:if> <xsl:if test="./@feildLen2 != ''"> length:<xsl:value-of select="./@feildLen1"/>-<xsl:value-of select="./@feildLen2"/>; </xsl:if> <!-- visible 属性 --> <xsl:if test="./@visible = 'false'"> <xsl:text>display:none;</xsl:text> </xsl:if> <!-- 是否是工单 --> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"> <xsl:text>border-style:none;</xsl:text> </xsl:if> <xsl:if test="./@feildRight = 'R'"> <xsl:text>border-color:red;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"> <xsl:text>border-style:none;</xsl:text> </xsl:if> <xsl:if test="./@feildNull = 'false'"> <xsl:text>border-color:red;</xsl:text> </xsl:if> </xsl:if> <xsl:if test="./@feildType = 'NUMBER'"> <xsl:text>dataType:NUMBER;</xsl:text> </xsl:if> <xsl:if test="./@feildType = 'VARCHAR2' or ./@feildType = 'VARCHAR'"> <xsl:text>dataType:STRING;</xsl:text> </xsl:if> <!-- 时间下拉框样式 属性 --> <xsl:if test="./@feildType = 'TIMESTAMP'"> <xsl:text>dataType:TIMESTAMP;</xsl:text> </xsl:if> <xsl:if test="./@feildType = 'DATE'"> <xsl:text>dataType:DATE;</xsl:text> </xsl:if> </xsl:attribute> <!-- readonly 属性 --> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"> <xsl:attribute name="readonly">true</xsl:attribute> </xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"> <xsl:attribute name="readonly">true</xsl:attribute> </xsl:if> </xsl:if> <!-- value 属性 --> <xsl:attribute name="value"><xsl:value-of select="./@feildValue"/></xsl:attribute> </input> </xsl:if> <!-- textarea --> <xsl:if test="./@feildLen1 >= 100"> <textarea rows="3" cols="28"> <!-- id 属性 --> <xsl:attribute name="id"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- name 属性 --> <xsl:attribute name="name"><xsl:value-of select="./@feildName"/></xsl:attribute> <!-- text --> <xsl:value-of select="./@feildValue"/> <!-- readonly 属性 --> <xsl:attribute name="readonly"> <xsl:if test="../attribute::isWorkOrder = 'true'"> <xsl:if test="./@feildRight = ''"><xsl:text>readonly</xsl:text></xsl:if> </xsl:if> <xsl:if test="../attribute::isWorkOrder = 'false'"> <xsl:if test="./@readOnly = 'true'"><xsl:text>readonly</xsl:text></xsl:if> </xsl:if> </xsl:attribute> </textarea> </xsl:if> </xsl:otherwise> </xsl:choose> </td> </xsl:if> </xsl:for-each> </tr> ...... ...... </table> </body> </html> </xsl:template> </xsl:stylesheet>
预览结果(不完全展示):
相关推荐
3,即入门级信息。 执照 根据 Apache 许可,版本 2.0(“许可”)获得许可; 除非遵守许可,否则您不得使用此文件。 您可以在以下网址获取许可证副本 兼容性 CDA XSL 已经过测试,可以与 Saxon-PE 和主要浏览器一起...
14.19.2 使用xsl:include进行包括 505 14.19.3 使用xsl:stylesheet在文档中嵌入样式单 505 14.20 本章小结 508 第15章 XSL格式化对象 508 15.1 XSL格式化语言概述 509 15.2 格式对象及其属性 510 15.2.1 fo命名域 ...
XSLT <br>8.1 何时使用XSLT 8.1.1 格式化 8.1.2 转换 8.2 XSL语言 8.3 使用XSL 8.4 XSL命名空间 8.5 剖析一个简单的XSL示例 8.5.1 添加处理指令 8.5.2 创建样式表 8.6 创建XSLT样式表...
xsl入门的好文章 新手学习XSL的好东西 XSL语法介绍 XSL学习心得 - 调用属性值 XSLT与XML转换的详细介绍 功能应用 读写搜索 基础教程 RSS Web2.0时代,RSS你会用了吗?(技术实现总结) 知识集锦:三分钟全面了解 Blog ...
16.1.2 ASP.NET AJAX 入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 第一篇窗口与界面编程 19 16.1.5 AJAX 简单示例 16.2 ASP.NET 3.5AJAX 控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件...
16.1.2 ASP.NET AJAX入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 16.1.5 AJAX简单示例 16.2 ASP.NET 3.5AJAX控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件(ScriptMangerProxy) 16.2.3...
16.1.2 ASP.NET AJAX入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 16.1.5 AJAX简单示例 16.2 ASP.NET 3.5AJAX控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件(ScriptMangerProxy) 16.2.3...
2.1.1 项目规范 2.1.2 设计表 2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 ...
16.1.2 ASP.NET AJAX入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 16.1.5 AJAX简单示例 16.2 ASP.NET 3.5AJAX控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件(ScriptMangerProxy) 16.2.3...
16.1.2 ASP.NET AJAX入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 16.1.5 AJAX简单示例 16.2 ASP.NET 3.5AJAX控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件(ScriptMangerProxy) 16.2.3...
16.1.2 ASP.NET AJAX入门 16.1.3 ASP.NET 2.0 AJAX 16.1.4 ASP.NET 3.5 AJAX 16.1.5 AJAX简单示例 16.2 ASP.NET 3.5AJAX控件 16.2.1 脚本管理控件(ScriptManger) 16.2.2 脚本管理控件(ScriptMangerProxy) 16.2.3...
2.1.1 项目规范 2.1.2 设计表 2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 ...
2.1.1 项目规范 2.1.2 设计表 2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 ...
2.1.1 项目规范 2.1.2 设计表 2.1.3 生成发票 2.2 引用完整性 2.2.1 通用完整性规则 2.2.2 特定于数据库的完整性规则 2.3 小结 第3章 SQL基础 3.1 SQL语言 3.2 SQL数据类型 3.3 数据定义语言 3.3.1 ...
2. python编程概述 2.1. 知识点 2.2. 良好的编程习惯 2.3. 常见编程错误 2.4. 测试和调试提示 2.5. 移植性提示 3. 控制流程 3.1. 知识点 3.2. 良好的编程习惯 3.3. 常见编程错误 3.4. 移植性提示 3.5. ...