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

  • 相关阅读:
    BigDecimal 和NumberFormat及 获取总页数的应用
    格式化小数点和百分号 DecimalFormatter
    Vue 项目开发
    js 对象补充
    Vue 实例成员
    Vue 指令
    Vue 介绍
    Vue
    request-html
    Python 中的经典类新式类
  • 原文地址:https://www.cnblogs.com/liuzhendong/p/2244799.html
Copyright © 2011-2022 走看看