Reputation: 2410
I'm using xmllint
as part of the linter settings in ALE (Asynchronous Lint Engine
, plugin for Vim
). The codebase I'm working on has a lot of HTML entities in XML. Not good, I know, but they're not harming anyone at the moment. So I'd like xmllint to not remind me everytime I open or save a file.
This is what xmllint says:
page.xml:54: parser error : Entity 'nbsp' not defined
<Element label=" " value="{__t.Delete}" action="{#delete}"/>
^
Is there any way of telling xmllint (directly, or via ALE) to not give me entity errors?
Upvotes: -1
Views: 89
Reputation: 12662
As a workaround, the --recover
option could be added. The document will be parsed provided that no other errors appear but missing entities will be removed.
Given
<root>
<Data>
<colA>def </colA>
</Data>
</root>
Result from xmllint --recover tmp2.xml
tmp2.xml:5: parser error : Entity 'nbsp' not defined
<colA>def </colA>
^
<?xml version="1.0"?>
<root>
<Data>
<colA>def</colA>
</Data>
</root>
WARNING: entities will be lost if document is saved
Upvotes: 0