我想根据子节点的属性对以下“测试套件”进行排序。在这种情况下“执行”。我怎么做 ?
这是我的 XML
<test-suite name="AnalyticsRequestTest" success="True" time="0.003" asserts="0">
<results>
<test-case name="IntegrationTests" executed="True" success="True" time="0.002" asserts="1" />
<test-case name="IntegrationTests1" executed="False" success="False" time="0.002" asserts="1" />
还有我的 XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="testsuites">
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:for-each select="//test-suite[(child::results/test-case)]">
<xsl:sort select="child::results/test-case[translate(@executed,$ucletters,$lcletters)='false']" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>