[squeak-dev] existing methods to unescape XML escaped characters.
gettimothy at zoho.com
Sun Nov 15 18:52:15 UTC 2020
I am storing parsed content from XTreams parsing in the XMLElement that Xtreams parsing uses....(could be different from stock Squeak XML package per recent discussion here.)
The XMLElements escape certain characters: https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_xml_escape.html
To get my content to display properly on Chrome, I have to unescape the escaped XML escaped characters.
I wrote a quick and dirty method to git-r-done....
xmls := aString copyReplaceAll:'>' with:'>' asTokens:false.
xmls := xmls copyReplaceAll:'<' with:'<' asTokens:false.
xmls := xmls copyReplaceAll:'"e;' with:'"' asTokens:false.
xmls := xmls copyReplaceAll:''' with:'''' asTokens:false.
xmls := xmls copyReplaceAll:'&' with:'&' asTokens:false.
However, I have a nagging suspicion I have re-invented the wheel; although I did spend significant time hunting for one.
If anything obvious jumps out, please respond.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev