Updated README, better xml docs

This commit is contained in:
Mike Farah
2022-01-22 12:35:33 +11:00
parent a0ba208669
commit 6f24e878aa
4 changed files with 116 additions and 66 deletions
+1 -13
View File
@@ -4,16 +4,4 @@ Encode and decode to and from XML. Whitespace is not conserved for round trips -
Consecutive xml nodes with the same name are assumed to be arrays.
All values in XML are assumed to be strings - but you can use `from_yaml` to parse them into their correct types:
```
yq e -p=xml '.myNumberField |= from_yaml' my.xml
```
```xml
<cat name="tiger">meow</cat>
```
The content of the node will be set as a field in the map with the key "+content". Use the `--xml-content-name` flag to change this.
XML content data and attributes are created as fields. This can be controlled by the `'--xml-attribute-prefix` and `--xml-content-name` flags - see below for examples.