- name:Add a phonenumber element to the business element. Implicit mkdir -p behavior where applicable
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/phonenumber
value:555-555-1234
- name:Add a owner element to the business element, testing implicit mkdir -p behavior 1/2
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/owner/name/last
value:Smith
- name:Add a owner element to the business element, testing implicit mkdir -p behavior 2/2
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/owner/name/first
value:John
- name:Add a validxhtml element to the website element. Note that ensure is present by default and while value defaults to null for elements, if one doesn't specify it we don't know what to do.
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/website/validxhtml
- name:Add an empty validateon attribute to the validxhtml element. This actually makes the previous example redundant because of the implicit parent-node creation behavior.
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/website/validxhtml/@validateon
- name:Add an empty validateon attribute to the validxhtml element. Actually verifies the implicit parent-node creation behavior.
# Now we repeat the same, just to ensure proper use of namespaces
- name:Add a phonenumber element to the business element. Implicit mkdir -p behavior where applicable
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/a:phonenumber
value:555-555-1234
namespaces:
a:http://example.com/some/namespace
- name:Add a owner element to the business element, testing implicit mkdir -p behavior 1/2
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/a:owner/a:name/a:last
value:Smith
namespaces:
a:http://example.com/some/namespace
- name:Add a owner element to the business element, testing implicit mkdir -p behavior 2/2
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/a:owner/a:name/a:first
value:John
namespaces:
a:http://example.com/some/namespace
- name:Add a validxhtml element to the website element. Note that ensure is present by default and while value defaults to null for elements, if one doesn't specify it we don't know what to do.
xml:
file:/tmp/ansible-xml-beers-implicit.xml
xpath:/business/a:website/a:validxhtml
namespaces:
a:http://example.com/some/namespace
- name:Add an empty validateon attribute to the validxhtml element. This actually makes the previous example redundant because of the implicit parent-node creation behavior.