This commit is contained in:
Mike Farah
2021-12-21 16:19:27 +11:00
parent ae8df5ea87
commit 6bcbd873a6
6 changed files with 51 additions and 11 deletions
+19
View File
@@ -141,3 +141,22 @@ will output
</cat>
```
## Encode xml: attributes with content
Fields with the matching xml-content-name is assumed to be content.
Given a sample.yml file of:
```yaml
cat:
+name: tiger
+content: cool
```
then
```bash
yq e -o=xml '.' sample.yml
```
will output
```xml
<cat name="tiger">cool</cat>
```