Disable strict XML parsing by default #1155

This commit is contained in:
Mike Farah
2022-03-28 14:05:10 +11:00
parent 3a1e2c7518
commit bbeae229ca
11 changed files with 86 additions and 14 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.