Topic
  • No replies
emime
emime
1 Post

Pinned topic regex or xpath?

‏2009-10-05T07:16:09Z |
Hello,
I would like to know what you would choose between regex or xpath.

Of course it depends from what you are going to do. Well, assume that you want to convert a xhtml 1.0 file to xml according to a cleaner and high-level schema.

I'm in doubt because actually it seems easier for me to use simple regular expressions than any XML parser (or any other). This is particularly true when having to strip or change xhtml inline elements.

I'm using ruby, so my choice will be REXML (or hpricot) or regex.

Thanks,
Emi