无法弄清楚如何在 augeas 中正确添加 onlyif

Can't figure out how to properly add onlyif in augeas

我有以下 xml:

<subsystem xmlns="urn:jboss:domain:undertow:1.1">
    <buffer-cache name="default"/>
    <server name="default-server">
        <http-listener max-post-size="104857600" name="undertow-http" proxy-address-forwarding="${proxy.address.forwarding}" receive-buffer="524288" redirect-socket="https" send-buffer="524288" socket-binding="http"/>
        <https-listener max-post-size="104857600" name="undertow-https" proxy-address-forwarding="${proxy.address.forwarding}" receive-buffer="524288" security-realm="ewb-ssl" send-buffer="524288" socket-binding="https" verify-client="NOT_REQUESTED"/>
        <host alias="localhost" name="default-host"/>
    </server>
    <servlet-container name="default">
        <jsp-config/>
        <persistent-sessions/>
    </servlet-container>
    <handlers/>
</subsystem>

对于 augeas,我正在更改其中的一些值 xml:

 set subsystem[#attribute/xmlns='urn:jboss:domain:undertow:1.1']/server[#attribute/name='default-server']/http-listener[#attribute/name='undertow-http']/#attribute/proxy-address-forwarding 'true'",

但在 运行 应用后 xml

中的以下属性
xmlns='urn:jboss:domain:undertow:1.1

更改为:

xmlns='urn:jboss:domain:undertow:1.2

然后 augeas 开始在 xml 文件中添加新字段:

<subsystem><server><http-listener proxy-address-forwarding="true"></http-listener>

我尝试添加 onlyif 条件以避免添加额外的字段但没有成功,有人可以帮忙吗?谢谢

适用于:

onlyif  => "get #attribute/xmlns == 'urn:jboss:domain:undertow:1.1'",