Lazarus

Programming => General => Topic started by: totya on August 13, 2019, 09:13:02 pm

Title: XML special chars convert [SOLVED by Leledumbo and wp]
Post by: totya on August 13, 2019, 09:13:02 pm
Hi!

I have a lines from a xml (I read it full manually because I need it), for example (code):

A < < B

This is mean (decode):

A < < B

Is there any built-in function in fpc/Lazarus to convert all exists xml codes (code and decode) from string to string?

Thanks!
Title: Re: XML special chars convert
Post by: Leledumbo on August 13, 2019, 09:34:51 pm
htmlelements unit from fcl-xml has both EscapeHTML and UnescapeHTML functions.
Title: Re: XML special chars convert
Post by: totya on August 13, 2019, 09:40:12 pm
htmlelements unit from fcl-xml has both EscapeHTML and UnescapeHTML functions.

Seems to me its working, thank you!
Title: Re: XML special chars convert [SOLVED by Leledumbo]
Post by: wp on August 13, 2019, 09:44:14 pm
Or use XMLValueToStr() from laz2_dom (https://lazarus-ccr.sourceforge.io/docs/lazutils/laz2_dom/xmlvaluetostr.html).
Title: Re: XML special chars convert [SOLVED by Leledumbo]
Post by: totya on August 13, 2019, 09:45:41 pm
Or use XMLValueToStr() from laz2_dom (https://lazarus-ccr.sourceforge.io/docs/lazutils/laz2_dom/xmlvaluetostr.html).

Thank you too, wp master :)