XSLT 知识小结

1. 自动格式化输出的XML:

                   <xsl:strip-space elements="*"/>

2. match 所有存在i:nil属性的节点:

                   <xsl:template match="@*|node()[@i:nil]"</xsl:template>

3. 在所有节点中查找:

                   <xsl:temp[late match="@*|node()">

4. 过滤所有以'hello'结尾的节点:

                    <xsl:if test="substring(name(),string-length(name())-4,5)!='hello'">

5. match 所有minOccurs为0的节点:

                    <xsl:template match="xs:element[@minOccurs='0']">

6. 判断节点的后面的兄弟节点的名称是否包含'hello'

      <xsl:if test='following-sibling::*[@name=concat($trueName,'hello')]">

7. 取节点的值

                        text()

原文地址:https://www.cnblogs.com/DataFlow/p/2138759.html