开发者

Exclude nodes based on attribute wildcard in XSL node selection

Using cruisecontrol for continuous integration, I have some annoyances with Weblogic Ant tasks and how they think that server debug information are warnings rather than debug, so are shown in my build report emails. The XML output from cruise is similar to:

<cruisecontrol>
<build>
    <target name="compile-xxx">
        <task name="xxx" />
    </target>
    <target name="xxx.weblogic">
        <task name="wldeploy">
            <message priority="warn">Message which isn't really a warning"</message>
        </task>
    </target>
</build>
</cruisecontrol>

In the cruisecontrol XSL template the current selection for the task list is:

<xsl:variable开发者_如何学编程 name="tasklist" select="/cruisecontrol/build//target/task"/>

What I would like is something which selects the tasklist in the same way, but doesn't include any target nodes which have the attribute name="*weblogic" where * is a wildcard. I have tried

<xsl:variable name="tasklist" select="/cruisecontrol/build//target[@name!='*weblogic']/task"/>

but this doesn't seem to have worked. I'm not an expert with XSLT, and just want to get this fixed so I can carry on the real development of the project. Any help is much appreciated.


In the cruisecontrol XSL template the current selection for the task list is:

<xsl:variable name="tasklist" select="/cruisecontrol/build//target/task"/>    

What I would like is something which selects the tasklist in the same way, but doesn't include any target nodes which have the attribute name="*weblogic" where * is a wildcard

Use:

  /cruisecontrol/build
                 //target
                     [not(substring(@name, string-length(@name)-7) 
                         = 'weblogic'
                          )
                     ]/task
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜