XML Text Summarizing

It's a real pain in the ass trying to cut down a post that's too long in XHTML. I mean, I can grab the text and measure how many kb is in the post so I can cut it, but then I have to figure out if I screwed up any matching tags. It's a complete nightmare.

Imagine you have a huge post, and now you want to limit it to 64k for a summary or for the first of several WAP pages. First, you have to make sure you didn't cut a tag in half some how, then you you have to back track through the rest of the tags - all the way to the first one, to make sure you've closed everything correctly. And this is assuming you have decent markup. If the markup somehow sucks, you have to go back and fix that first as well.

Urgh. Is there something out there that either does this, or an article that explains the best methods so I don't have to spend the next week getting it right?


< Previous         Next >