zoukankan      html  css  js  c++  java
  • [XSLT] 遍历所有节点的XSLT

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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" version="2.0">
        <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
        <xsl:template match="/">
            <table border="1" cellspacing="0" height="100%" width="100%">
                <xsl:for-each select="./*">
                    <tr>
                        <th class="k-header" style="80">
                            <xsl:value-of select="local-name()"/>
                        </th>
                        <td>
                            <xsl:call-template name="SubItem"/>
                        </td>
                    </tr>
                </xsl:for-each>
            </table>
        </xsl:template>
        <xsl:template name="SubItem">
            <xsl:if test="count(./*)=0">
                <xsl:value-of select="."/>
            </xsl:if>
            <xsl:if test="count(./*)>0">
                <table border="1" cellspacing="0" height="100%" width="100%">
                    <xsl:for-each select="./*">
                        <tr>
                            <th class="k-header" style="80">
                                <xsl:value-of select="local-name()"/>
                            </th>
                            <td>
                                <xsl:call-template name="SubItem"/>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
  • 相关阅读:
    定时器
    Vue CLI环境变量
    负数的二进制表示方法
    IDEA指定启动JDK版本
    Windows7安装两个jdk配置
    Bloom Filter 数据结构去重
    新浪微博爬虫参考
    Spring Data JPA
    Spring的JDBC框架
    数据库连接池:Druid
  • 原文地址:https://www.cnblogs.com/xuzhong/p/2969889.html
Copyright © 2011-2022 走看看