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>
  • 相关阅读:
    进程,进程
    hmac和socketserver
    下载Eclipse、下载Java各个版本,来这里就对了
    Java循环语句怎么用?经典排序算法见真知
    CSS基本语法
    Html属性标签
    HTML标记大全参考手册
    composer 安装Laravel (win10)
    composer 安装(win)
    GIT
  • 原文地址:https://www.cnblogs.com/xuzhong/p/2969889.html
Copyright © 2011-2022 走看看