This commit is contained in:
Mike Farah
2021-12-21 14:58:36 +11:00
parent d289ddc7e3
commit 7e0f9935ba
7 changed files with 55 additions and 7 deletions
+16
View File
@@ -271,3 +271,19 @@ cat thing1,thing2 true 3.40
dog thing3 false 12
```
## Decode a xml encoded string
Given a sample.yml file of:
```yaml
a: <foo>bar</foo>
```
then
```bash
yq eval '.b = (.a | from_xml)' sample.yml
```
will output
```yaml
a: <foo>bar</foo>
b:
foo: bar
```
@@ -14,6 +14,7 @@ These operators are useful to process yaml documents that have stringified embed
| Properties | | to_props/@props |
| CSV | | to_csv/@csv |
| TSV | | to_tsv/@tsv |
| XML | from_xml | |
CSV and TSV format both accept either a single array or scalars (representing a single row), or an array of array of scalars (representing multiple rows).