Concatinating with .replaceAll

steelej's Avatar

steelej

10 Jan, 2013 02:49 PM

Our Campus Life dept. insists on using a calendar service rss feed that has caused me no end of problems. Previously Cascade choked on inserted non-breading-spaces, which I fixed by using .replaceAll. Now it is choking on apostrophes which come through in their rss as ’ as in the example below:

Start your semester off right with Weekends@WIT Mystery Bingo. Each winner will get to select a wrapped prize, and who knows what’s inside? It could be a prize worth $3, or $300. You could win Gift cards, DVDs, W@W sweatshirts, even an Xbox! But you won’t know until you win. Email [email blocked] with questions.
Weekends@WIT is also looking for some work study students for the spring. If you’re work-study approved and free from 8-11pm on Saturdays email Eric Crumrine at [email blocked] for more information.

I've been trying to concatenate this phrase in the .replaceAll statement with no luck. The feed address is:

https://orgsync.com/calendar/org/rss/501302/f7e897002fa6d44bd352f1c...

Any help would surely be welcome. My script is attached.

  1. 1 Posted by Ryan Griffith on 10 Jan, 2013 03:58 PM

    Ryan Griffith's Avatar

    Hi,

    After a little bit of local testing, I believe the underlying issue is with the double-encoded named entities. When outputting the entities, the ampersand is being encoded and then the parser is not recognizing the resulting named entity (which is why you are seeing that parser error).

    I was able to created a macro that re-encodes the ampersand and loops through a map of entities and replaces them with a corresponding symbol. Please see the attached Format.

    Note: you can also replace the named entities with their numeric counterpart, because the parser properly recognizes numeric entities (unlike the named entities). For example, instead of replacing ’ with a single quote/apostrophe, you can use &#180 (or the acute symbol).

    Please let me know if you have any questions.

    Thanks

  2. 2 Posted by steelej on 10 Jan, 2013 05:12 PM

    steelej's Avatar

    Ryan,
    Thanks very much. This works great. I'll spend some time with your macro. I wouldn't have gotten here without your help.

    Much Obliged,

    Jim

  3. 3 Posted by Ryan Griffith on 10 Jan, 2013 05:20 PM

    Ryan Griffith's Avatar

    Not a problem at all, Jim. Glad to hear it got the ball rolling.

    Have a great day!

  4. Ryan Griffith closed this discussion on 10 Jan, 2013 05:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac