Parsing XML and Cleaning Up the Results

By sadcox | Nov 26, 2008

Slow going on my latest plugin…not much spare time for development, and we have to pay the bills, right?  There were a couple of issues I needed solved, and I went to the web to find the answers, just like always.  The first thing I needed to do was parse an XML result.  Actually, “parsing” was just the beginning of what I needed to do.  I actually needed to store the XML in a structure so that I could do a lot of different things with the data.  I found this great article (and class) over at DevArticles.com that gave me exactly what I needed.  Sure, I could have written this myself, but why bother when someone else has already posted the solution, right?  First issue solved.

Once I’d broken the data down, I needed to use some of it.  Not a problem, except that you get some really weird characters if your results contain quotes, double quotes, etc.  Here are some of the ones I received: â€œ, â€, â€˜, and â€™.  This post has a nice little array set up to take care of those issues.  I implemented it, and it works beautifully.

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 Openside Solutions, - PassionDuo WordPress Theme