[EMAIL PROTECTED] writes:

>         foldXml     (txt ?> keep :>
>                         fontSize4 /> tag "em" ?> mkSubtitle             :>
>                         children)
> now transforms
>         <font size="4"><em>Hello World</em></font>
> into
>         <h1 class="subtitle"><em><Hello World</em></font>
> 
> I still have a problem with the other example:
>         <em><font size="4">Hello World</font></em>

Ah, I see.  In the first case, you simply change the <font> tag into
<h1>, keeping the <em> tag exactly the same.  But in the second case,
you not only want to change <font> into <h1>, but also to move the <em>
tag from outside the <font> to inside.

I think you need something like this:

     mkSubtitle `o` (tag "em" /> fontSize4 /> mkElem "em") |>| children

i.e. build an <em> around the children of the <font> tag, and then
build the <h1> subtitle around the outside of that.

Regards,
    Malcolm
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to