[squeak-dev] existing methods to unescape XML escaped characters.
Davide Grandi
davide.grandi at email.it
Sun Nov 15 22:15:24 UTC 2020
... I'd look for apos - quotes - amp - gt - lt in sources and changes.
... or directly in String instances and then in their references ...
looking for compiled methods, blocks and so on.
(a dirty reinvented wheels to run on a muddy road)
davide
On 15/11/2020 19:52, gettimothy via Squeak-dev wrote:
> Hi Folks,
>
> 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
> <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....
>
>
> unEscapeXMLEscapeCharaters: aString |xmls| 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. ^xmls
>
> 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.
>
> thx.
>
>
>
>
--
Ing. Davide Grandi
email : davide.grandi at email.it
linkedin : http://linkedin.com/in/davidegrandi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201115/cedd6b6e/attachment.html>
More information about the Squeak-dev
mailing list
|