This commit is contained in:
Mike Farah
2022-03-28 14:24:57 +11:00
parent 3cca5f7aff
commit 58f27a1f20
6 changed files with 151 additions and 0 deletions
+25
View File
@@ -120,6 +120,31 @@ cat:
+legs: "4"
```
## Parse xml: custom dtd
DTD entities are ignored.
Given a sample.xml file of:
```xml
<?xml version="1.0"?>
<!DOCTYPE root [
<!ENTITY writer "Blah.">
<!ENTITY copyright "Blah">
]>
<root>
<item>&writer;&copyright;</item>
</root>
```
then
```bash
yq -p=xml '.' sample.xml
```
will output
```yaml
root:
item: '&writer;&copyright;'
```
## Parse xml: with comments
A best attempt is made to preserve comments.