Created
April 28, 2023 12:59
-
-
Save davidsheardown/34449353f9786c9515348c3c8a18c290 to your computer and use it in GitHub Desktop.
Decode or Encode XML where you are working with < or > sort of thing
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
Public Function DecodeXml(TextToDecode As String) As String | |
'Take text that has been encoded for XML and change it to normal text | |
Dim Res As String | |
Res = Replace(Replace(Replace(Replace(TextToDecode, """, """"), ">", ">"), "<", "<"), "&", "&") | |
DecodeXml = Res | |
End Function | |
Public Function EncodeXml(TextToEncode As String) As String | |
'Take text and change special chars so that it can be included in an XML file | |
Dim Res As String | |
Res = Replace(Replace(Replace(Replace(TextToEncode, "&", "&"), ">", ">"), "<", "<"), """", """) | |
EncodeXml = Res | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment