我有这个 application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application id="Application_1326308152661" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<description>MIC Server Application.</description>
<module>
<web> ...
</web>
</module>
<module>
<ejb>mic-sqlbridge.jar</ejb>
</module>
<security-role> ...
</security-role>
</application>
在此 xml 中,必须删除包含标签 ejb 的部分“模块”标签。为此,我尝试了
<xmltask source="application.xml" dest="application_X.xml">
<remove path="/application/module[ejb/text() = 'mic-sqlbridge.jar']"/>
</xmltask>
不幸的是,这并没有删除任何东西 - 这是日志部分:
[xmltask] Reading application.xml
[xmltask] Executing xmltask 1.16
[xmltask] Processing application.xml into application_X.xml
[xmltask] Using predefined xml catalog
[xmltask] Applying RemovalAction() to /application/module[ejb/text() = 'mic-sqlbridge.jar']
[xmltask] Applied RemovalAction() - 0 match(es)
[xmltask] RemovalAction() (/application/module[ejb/text() = 'mic-sqlbridge.jar']) failed to match
[xmltask] Normalizing resultant document
任何想法?提前致谢!
坦率