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

📝 Document nested node addition with "_" in xml module (#2371) (#2427)

* 📝 Document nested node addition with "_" in xml module

Nested node addition using "_" to indicate sub nodes, and attributes are only documented in tests and issues, where is hard to find.

* 🚨 Fix trailing space

* Apply suggestions from code review

Add missing collection prefix for modules.

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add missing comments

* Update xml.py

* Fix linter warnings

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4b0d2dcfe0)

Co-authored-by: Daniel-Sanchez-Fabregas <33929811+Daniel-Sanchez-Fabregas@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-05-03 08:12:31 +02:00 committed by GitHub
parent 05666b0e4d
commit 007333dbfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,6 +285,22 @@ EXAMPLES = r'''
z: http://z.test z: http://z.test
attribute: z:my_namespaced_attribute attribute: z:my_namespaced_attribute
value: 'false' value: 'false'
- name: Adding building nodes with floor subnodes from a YAML variable
community.general.xml:
path: /foo/bar.xml
xpath: /business
add_children:
- building:
# Attributes
name: Scumm bar
location: Monkey island
# Subnodes
_:
- floor: Pirate hall
- floor: Grog storage
- construction_date: "1990" # Only strings are valid
- building: Grog factory
''' '''
RETURN = r''' RETURN = r'''