Created
July 13, 2017 12:28
-
-
Save da2x/4afd13c2806d0175bd382f5d787bd81d to your computer and use it in GitHub Desktop.
Extracting the text node of an XML element containing a double-escaped entety.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import xml.etree.ElementTree as ETree | |
>>> ETree.fromstring("<test>&rdquo;</test>").text | |
'”' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most feed reader implementations won’t know to do that extra step at the end. Named HTML-entities are quite rare in XML, especially double escaped ones.