我正在使用 augeas 在某些机器上操作 XML。虽然创建新节点并设置一堆属性就像一种魅力,但我正在为向 XML 文件添加一个简单的属性而苦恼。XML 如下所示:
<?xml version="1.0"?>
<Context>
<WatchedResource></WatchedResource>
</Context>
我不只是试图通过添加allowLinking="true"
到上下文根节点
set /files/path/to/my/file.xml/Context/#attribute/allowLinking "true"
不幸的是,这总是失败
/error = "put_failed"
/error/path = "/files/path/to/my/file.xml/Context"
/error/lens = "/usr/share/augeas/lenses/dist/xml.aug:134.10-.73:"
/error/message = "Failed to match \n { /#attribute/ }?({ /#text/ …
我正在使用 puppet 开源 3.4.2 和 augeas 1.0.0。
任何建议我做错了什么?