Fidel Posted December 29, 2008 Share Posted December 29, 2008 Hello, I've got a string which I've read from an XML file. I'm extracting a bit of text from an element: <author>Bob & John</author> Since I'm looking for the author tag, then doing a StringMid, I get the following: "Bob & John" However, I'd like to get: Bob & John Is there a function I can call to remove XML escape characters? Thankyou, Fidel Link to comment Share on other sites More sharing options...
Zedna Posted December 29, 2008 Share Posted December 29, 2008 $xml = StringReplace($xml, '&', '') Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Fidel Posted December 29, 2008 Author Share Posted December 29, 2008 $xml = StringReplace($xml, '&', '') thanks for the quick reply, I will use this if there's not a more generic function to deal with all the other possibilities... Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 29, 2008 Share Posted December 29, 2008 thanks for the quick reply, I will use this if there's not a more generic function to deal with all the other possibilities... There is no general function to translate XML (or HTML) escaped character sequences. It would be easy to write for you specific needs though. What exactly do you mean by "all the other possibilities"? Do you want to write a single function to also find and replace '>', '<', ''', etc.? P.S. In Zedna's example, the replacement character was missing: $xml = StringReplace($xml, '&', '&') Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now