zoukankan      html  css  js  c++  java
  • XSL

    创建 XSL 样式表
    然后创建一个带有转换模板的 XSL 样式表("cdcatalog.xsl"):

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
      <html>
      <body>
        <h2>My CD Collection</h2>
        <table border="1">
        <tr bgcolor="#9acd32">
          <th align="left">Title</th>
          <th align="left">Artist</th>
        </tr>
        <xsl:for-each select="catalog/cd">
        <tr>
          <td><xsl:value-of select="title"/></td>
          <td><xsl:value-of select="artist"/></td>
        </tr>
        </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>

    </xsl:stylesheet>查看 "cdcatalog.xsl"
    把 XSL 样式表链接到 XML 文档
    向 XML 文档("cdcatalog.xml")添加 XSL 样式表引用:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
    <catalog>
      <cd>
        <title>Empire Burlesque</title>
        <artist>Bob Dylan</artist>
        <country>USA</country>
        <company>Columbia</company>
        <price>10.90</price>
        <year>1985</year>
      </cd>

    </catalog>

    XSLT <template>
    XSLT <xsl:value-of>
    XSLT <for-each>
    XSLT <sort>
    XSLT <if>
    XSLT <choose>
    XSLT apply

  • 相关阅读:
    [转]C++ Operator Overloading Guidelines
    SICP学习笔记(2.2.1)
    .net中模拟键盘和鼠标操作
    javaScript系列 [17]运算符
    javaScript系列 [24]Math
    javaScript系列 [19]string
    javaScript系列 [22]引用类型
    javaScript系列 [12]Canvas绘图(曲线)
    javaScript系列 [15]Canvas绘图(压缩)
    javaScript系列 [21]Array
  • 原文地址:https://www.cnblogs.com/liuzhendong/p/2244799.html
Copyright © 2011-2022 走看看