[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

Peter Gammie peteg42 at gmail.com
Wed May 21 05:30:38 EDT 2008


On 30/04/2008, at 5:32 PM, Malcolm Wallace wrote:

> Peter Gammie <peteg42 at gmail.com> wrote:
>
>> The most-recent darcs version relies on a newer ByteString than I
>> have, so it is not easy for me to test it.
>
> I believe there was a patch to fix this.  Apparently only one  
> version of
> the bytestring package (0.9.0.1) ever exported the 'join' function,  
> and
> a different version with the same number (but not exporting 'join')  
> was
> uploaded to Hackage!  'Join' has since been replaced by 'intercalate',
> which is available in all versions 0.9.x.

Thanks. I don't doubt it works with a newer bytestring, I just can't  
readily use such a thing.

>> A recent (this year) darcs version failed to parse the DTD, yielding
>> this error:
>
> I didn't try the full XHTML DTD, but the fragment you included in your
> message was parsed just fine by the darcs version of HaXml/ 
> DtdToHaskell.

Can you please try the full XHTML 1.0 Strict DTD? At the same time,  
can you verify that it handles this part of it properly (circa line  
854):

<!ELEMENT table
      (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>

Using a slightly hacked HaXml v1.13.3, I get this from DtdToHaskell:

data Table = Table Table_Attrs (Maybe Caption)
                    (OneOf2 [Col] [Colgroup]) (Maybe Thead) (Maybe  
Tfoot)
                    (OneOf2 (List1 Tbody) (List1 Tr))
            deriving (Eq,Show)

My expectation is that we can have a <table> without a <col> or  
<colgroup> child. The W3 validator seems to agree with that  
interpretation. When I use the HaXml validator with this DTD I get  
this (e.g.):

Element <table> should contain (caption?,(col*| 
colgroup*),thead?,tfoot?,(tbody+|tr+)) but does not.

Element <table> should contain (col*|colgroup*) but does not.

cheers
peter


More information about the Haskell-Cafe mailing list