如何解决在 xml 文件中,如果该属性不存在,则使用 shell 脚本将属性附加到节点元素
我对使用 Shell 脚本的 xml 文件有以下要求
独立.xml 文件
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:11.0">
<profile>
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-enabled="false" scan-interval="5000" deployment-timeout="600"/>
</subsystem>
...........Other subsystems tags.......
<server>
是否要检查节点是否包含“deployment-timeout”属性
if exist read the value then check
if the value is <900
update the value to 900
else
Leave as it is
else
Append attribute with value i.e deployment-timeout="900" to node <deployment-scanner> at the end like this
*<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-enabled="false" scan-interval="5000" deployment-timeout="900"/>*
Please help me...
advance thanks
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。