plugin-xml icon indicating copy to clipboard operation
plugin-xml copied to clipboard

Failed to parse XML containing attributes with special characters

Open luisg123v opened this issue 3 years ago • 2 comments

bracketSameLine

No response

printWidth

No response

tabWidth

No response

xmlWhitespaceSensitivity

strict

xmlSelfClosingSpace

No response

Input XML

<?xml version="1.0" encoding="utf-8" ?>
<node attributeá="value" />

Current output XML

[error] file.xml: Error: unexpected character: ->á<-

Expected output XML

XML should be parsed, as the same XML is parsed correctly by lxml despite special characters:

>>> from lxml import objectify
>>> xml = objectify.fromstring('<node attributeá="value" />')
>>> xml.attrib
{'attributeá': 'value'}
>>>

luisg123v avatar Oct 11 '22 00:10 luisg123v

CC @moylop260 @luistorresm

luisg123v avatar Oct 11 '22 00:10 luisg123v

I've opened an issue on the upstream parser here: https://github.com/SAP/xml-tools/issues/407.

kddnewton avatar Oct 11 '22 13:10 kddnewton

Closing this as it's being tracked over on that other issue. Sorry about this @luisg123v I'm at the mercy of the parser. If you feel like a contribution, that'd be a great place.

kddnewton avatar Oct 18 '22 16:10 kddnewton

@kddnewton roger, I'll be following that other issue.

Thanks a lot.

luisg123v avatar Oct 18 '22 17:10 luisg123v