mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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:
parent
f7403a0b34
commit
3987b8a291
1 changed files with 17 additions and 0 deletions
|
@ -301,6 +301,23 @@ EXAMPLES = r'''
|
||||||
- floor: Grog storage
|
- floor: Grog storage
|
||||||
- construction_date: "1990" # Only strings are valid
|
- construction_date: "1990" # Only strings are valid
|
||||||
- building: Grog factory
|
- 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'''
|
RETURN = r'''
|
||||||
|
|
Loading…
Reference in a new issue