The goal here is to add an entry to the user-places.xbel file which manages bookmarks for file managers.
See below both the expected output (the <bookmark:icon> entry), as well as the overall document structure of the xbel file.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xbel>
<xbel xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
xmlns:kdepriv="http://www.kde.org/kdepriv"
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
>
<info>
<!-- left out for simplicity -->
</info>
<bookmark href="ADDRESS">
<title>My bookmark</title>
<info>
<metadata owner="http://freedesktop.org">
<bookmark:icon name="network-workgroup"/>
</metadata>
<metadata owner="http://www.kde.org">
<ID>123467890/0</ID>
<OnlyInApp></OnlyInApp>
<isSystemItem>false</isSystemItem>
<isHidden>false</isHidden>
</info>
</bookmark>
</xbel>
I use Ansibles community.general.xml to edit this document. This is my task definition:
- name: Add file manager entry for NAS
community.general.xml:
path: .local/share/user-places.xbel.bak
xpath: /xbel
pretty_print: yes
namespaces:
bookmark: "http://www.freedesktop.org/standards/desktop-bookmarks"
add_children:
- bookmark:
href: 'ADDRESS'
_:
- title: My bookmark
- info:
_:
- metadata:
owner: 'http://freedesktop.org'
_:
- "{bookmark}icon":
name: 'network-workgroup'
- metadata:
owner: 'http://www.kde.org'
_:
- ID: '1234567890/0'
- OnlyInApp: ''
- isSystemItem: 'false'
- isHidden: 'false'
However, this generates this tag:
<ns0:icon xmlns:ns0="bookmark" name="network-workgroup"/>
instead of the expected tag:
<bookmark:icon name="network-workgroup"/>
What should I change?