XML + XSL + JS 构建小型Web App (十一)

来源:互联网 发布:做淘宝主图有几种格式 编辑:程序博客网 时间:2024/06/05 19:33

样式单文件源代码  (主要是表格的构建:) ):

 

<?xml version="1.0" encoding="GB2312"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xml:space="preserve">

   <xsl:output encoding="gb2312"/>

   <xsl:template match="/履历列表/履历元素">

       <html>

          <head>

             <title>

                 <xsl:value-of select="/姓名"/>个人简历</title>

             <style>

                 table{cellpadding:0;cellspacing:0;border-collapse:collapse;}

                 td{border:1px solid black;font-size:12px;}

                 th{border:1px solid black;font-size:12px;}

                 p{font-size:12px;}

             </style>

          </head>

          <body>

             <p style="font-weight:800;font-size:24px;" align="center">

                 <xsl:value-of select="/姓名"/>

                 个人简历

                 </p>
         
<p align="center">

                 <table width="600px">

                    <tr>

                       <th width="15%">姓名</th>

                       <td width="15%">

                           <xsl:value-of select="/姓名/"/>

                           <xsl:value-of select="/姓名/"/>

                       </td>

                       <th  width="15%">性别</th>

                       <td width="15%">

                           <xsl:value-of select="/性别"/>

                       </td>

                       <td rowspan="3" width="15%">

                       <img alt="照片" width="100px" src="{/照片路径/@val}"/>

                       </td>

                    </tr>

 

原创粉丝点击