There are two bigger hammers you could get out for this: DOM and XSLT. DOM would let you manipulate the tree and the contents. XSLT does the same thing but has a bigger learning curve. XSLT will be a lot pickier about the input HTML being good conformant XML as well.
no subject
Date: 2008-01-07 03:31 am (UTC)