【发布时间】:2021-07-28 08:00:43
【问题描述】:
我不能用 xmlstarlet 替换属性。
狗.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd">
<rabbit:connection-factory id="mqConnectionFactory"
host="localhost"
port="9999" />
</beans>
已经尝试了以下多种变体:
xmlstarlet ed -N B="http://www.springframework.org/schema/beans" -N R="http://www.springframework.org/schema/rabbit" --update "/B/R:connection-factor/@host" --value "myserver" dog.xml
我错过了什么?我已经尝试过 beans 和 B:beans for B 和 R 的许多变体,但我认为没有选择正确的元素。
【问题讨论】:
标签: namespaces xml-namespaces xmlstarlet