zoukankan      html  css  js  c++  java
  • XSL相关

    <?xml version="1.0" encoding="utf-8" ?>
    <?xml-stylesheet type="text/xsl" href="C:UsersAdministratorDesktopemp1.xsl" ?>
    <employees>
      <employee on="01">
        <name>Tom</name>
        <sex>男</sex>
        <birth>
          <year>1982</year>
          <month>5</month>
          <day>22</day>
        </birth>
        <sales>
          <year>2010</year>
          <month>1</month>
          <sale>320000</sale>
        </sales>
        <salary>8600</salary>
      </employee>
      
      <employee on="02">
        <name>Jack</name>
        <sex>男</sex>
        <birth>
          <year>1981</year>
          <month>7</month>
          <day>10</day>
        </birth>
        <sales>
          <year>2010</year>
          <month>1</month>
          <sale>300000</sale>
        </sales>
        <salary>6000</salary>
      </employee>
      <employee on="03">
        <name>Jennifer</name>
        <sex>女</sex>
        <birth>
          <year>1982</year>
          <month>6</month>
          <day>22</day>
        </birth>
        <sales>
          <year>2010</year>
          <month>1</month>
          <sale>500000</sale>
        </sales>
        <salary>7000</salary>
      </employee>
      
    </employees>
    =========================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:fn="http://www.w3.org/2005/xpath-functions" 
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
    <!-- 模板 -->
      <xsl:template match="/employees/employee">
         <html>
    <head><title></title></head>
    <body>
       <div>
                        <u>
           <h2>编号:<xsl:value-of select="@no"/>  </h2>
               </u>    
       </div>
       <div>
           姓名:<xsl:value-of select="name"/>
       </div>
       <div>
            <i> 
              生日:
              <xsl:value-of select="birth/year"/>年
              <xsl:value-of select="birth/month"/>月
              <xsl:value-of select="birth/day"/>日
            </i>
       </div>
    </body>
         </html>
      </xsl:template>
    </xsl:stylesheet>
  • 相关阅读:
    安装node配置环境变量,解决某组件(如cordova,webpack等)“不是内部命令”问题
    用js控制css属性
    用javascript动态改变网页文字大小
    在无代码文件的aspx文件中添加类、函数和字段的方法
    HBase-0.98.3 如何调整RPC连接的数量
    double类型相等判断 [转]
    Virtual Memory Usage from Java under Linux [转]
    手工释放SWAP空间的方法[转]
    maven配置 指定jdk版本
    maven配置: 生成war的同时生成jar, 并在其他artifact配置依赖于这个jar
  • 原文地址:https://www.cnblogs.com/blogLYF/p/5653958.html
Copyright © 2011-2022 走看看