Invalid Char Error
  • I just recently started using MarsEdit and am getting the error "XML-RPC Response Parsing Failed: The operation couldn't be completed. PCDATA invalid Char value 25.

    I started using MarsEdit when I moved my Tumblr blog to Wordpress by copying and pasting all the posts. I googled around, and Daniel usually asks to post the network log. Here's mine, since it's very long: http://d.pr/UC0e

    I understand that I have to use the Zap Gremlins feature in TextWrangler, but I'm not sure how to use it (newbie here!). Also, once I find the offending characters, do I simply edit the post to fix the offending characters?

    Thanks for the support!
  • Hi Marcelo - thanks for sending the log by email, I was able to open it up and find the offending characters. To answer your question, yes, you have to edit the posts in the web admin panel because the bad characters are preventing the communication from succeeding through the XML-RPC interface.

    The first string of bad characters is in:

    http://behindcompanies.com/2011/01/respect-the-dirty-work/

    At the very end of the post, there are three invisible characters right after the closing quotation mark. If you edit the HTML source of the post you might have to find the spot between the quotation mark and the tag, and delete them.

    The other bad character is in:

    http://behindcompanies.com/2011/01/monkeys-climbing-a-pole/

    Look at the URL you link to in the Steve Blank link "blogged about it last year" … there's a bad character in the URL itself, and you'll see that it actually causes the link to fail when you try to click through on a browser, as well.

    I think once these are fixed up it will load correctly in MarsEdit.

    Daniel
  • Thanks, Daniel! It worked great.

    Just a thought - I saw a lot of these errors when I was searching, perhaps you could put up a blog post about how to use TextWrangler to find these errors? Might save you some time looking at logs :)
  • Heh, yeah, well fortunately it doesn't come up all that often. But I do want to try to come up with a more systematic solution at some point.
  • Just ran into this for the second or third time in the past few years. I resolved it without your help this time, Daniel! I looked at the log and found the network reply with a "Succeeded: NO", then copied the response text (a chunk of XML with a methodResponse) into a separate file and opened it with Oxygen (an XML editor). Oxygen immediately identified the offending characters and all I had to do then was eliminate them using the WP backend to edit the page. Thank you so much for including the network log functionality in MarsEdit, that's a life-saver.

    As to more graceful treatment, it would probably require a different attempt at parsing the XML that was better about pinpointing the offending text. If you could do that, then you could report out the page with the problem, or even the pinpoint the range of text where the offense occurred.

    In any case, thanks for giving us the tools we need to dig into this sort of problem.
  • Thanks for letting me know, efc. Hopefully in the next few years I'll come up with a solution that prevents you having to do any work at all to fix it! Yeah, something like a pre-flight to sanitize the XML would probably solve this, though I have to be careful to not destroy (alter) any of the XML content without making it very clear to the user what I'm doing.
  • FYI, I also learned that pasting the XML from the network log into the XML validator at W3C will pinpoint the errors as well. If anyone is trying to find one of these errors, give it a go at http://www.w3schools.com/Dom/dom_validate.asp
  • Nice tip! Maybe I should try that next time, might be faster than the BBEdit route.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!