[Haskell-cafe] Elementary HaXml question

Koen.Roelandt at mineco.fgov.be Koen.Roelandt at mineco.fgov.be
Thu Feb 9 05:48:39 EST 2006

Hi all,

I'm new to Haskell and HaXml and I'm playing around with the latter to 
clean some (well-formed) 'legacy' html. This works fine except for the 
following cases. Some of the elements to be cleaned are:

        <font size="4"><i>Hello World</i></font>
        <i><font size="4">Hello World</font></i>

This should become:

        <h1 class="subtitle">Hello World</h1>
I can build filters to find <font>, <font size="4"> or <i>, but the 
combination does not seem to work.
>From what I could gather from the documentation, it should be something 

foldXml         (txt ?> keep :>
                (attrval("size",AttValue[Left "4"]) `o` tag "font") /> tag 
"i" ?> replaceTag "h1"  :>

This doesn't work. I am clearly missing something elementary here, so any 
hints are welcome.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060209/aea7242e/attachment.htm

More information about the Haskell-Cafe mailing list