Jump to content

Recommended Posts

Posted (edited)

Today I was working on some Webservices UDF.
As a result I get this kind of data:

  Quote

<root>
<Data>
<Type>F</Type>
</Data>
</root>

Expand  

I was searching here:

http://www.htmlhelp.com/reference/html40/entities/special.html
http://www.html-entities.org/
http://www.w3schools.com/html/html_entities.asp

 

But finally I made this:

#include <IE.au3>

_Example()
Func _Example()
    Local $sHTML = _
            '&lt;root&gt;&#xD;&lt;Data&gt;&#xD;&lt;Type&gt;F&lt;/Type&gt;&#xD;&lt;/Data&gt;&#xD;&lt;/root&gt;'
    MsgBox(0, 'TEST', _HTML_DecodeEntities($sHTML))
EndFunc   ;==>_Example


Func _HTML_DecodeEntities(ByRef $sHTML)
    $sHTML = StringReplace($sHTML,'&#xD;','<hr>')
    Local $oIE = _IECreate("about:blank", 0, 0, 1, 0)
    _IEDocWriteHTML($oIE, $sHTML)
    Local $sResult = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    Return $sResult
EndFunc   ;==>_HTML_DecodeEntities

 

Regards,
mLipok

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...