1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

xml: Add an example for absent (#2644) (#2656)

Element node can be deleted based upon the attribute
value.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 795125fec4)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
patchback[bot] 2021-05-27 20:18:07 +02:00 committed by GitHub
parent f7403a0b34
commit 3987b8a291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -301,6 +301,23 @@ EXAMPLES = r'''
- floor: Grog storage
- construction_date: "1990" # Only strings are valid
- building: Grog factory
# Consider this XML for following example -
#
# <config>
# <element name="test1">
# <text>part to remove</text>
# </element>
# <element name="test2">
# <text>part to keep</text>
# </element>
# </config>
- name: Delete element node based upon attribute
community.general.xml:
path: bar.xml
xpath: /config/element[@name='test1']
state: absent
'''
RETURN = r'''