mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
v4.30.5
This commit is contained in:
parent
95a5e3b9e3
commit
cdc91e518f
21
usage/xml.md
21
usage/xml.md
@ -152,6 +152,27 @@ cat:
|
|||||||
+@legs: "4"
|
+@legs: "4"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Parse xml: content split between comments/children
|
||||||
|
Multiple content texts are collected into a sequence.
|
||||||
|
|
||||||
|
Given a sample.xml file of:
|
||||||
|
```xml
|
||||||
|
<root> value <!-- comment-->anotherValue <a>frog</a> cool!</root>
|
||||||
|
```
|
||||||
|
then
|
||||||
|
```bash
|
||||||
|
yq -p=xml '.' sample.xml
|
||||||
|
```
|
||||||
|
will output
|
||||||
|
```yaml
|
||||||
|
root:
|
||||||
|
+content: # comment
|
||||||
|
- value
|
||||||
|
- anotherValue
|
||||||
|
- cool!
|
||||||
|
a: frog
|
||||||
|
```
|
||||||
|
|
||||||
## Parse xml: custom dtd
|
## Parse xml: custom dtd
|
||||||
DTD entities are processed as directives.
|
DTD entities are processed as directives.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user