[Haskell-cafe] Re: HaXml: ampersand in attribute value

Koen.Roelandt at mineco.fgov.be Koen.Roelandt at mineco.fgov.be
Fri Feb 17 10:14:07 EST 2006


> But speaking of HaXml bugs, I'm pretty sure HaXml doesn't handle
> % correctly.  It seem to treat % specially everywhere, but I think
> it is only special inside DTDs.  I have many XML files produced by
> other tools that the HaXml parser fails to process because of this.

I had a similar problem where the parser choked on % signs in attribute 
values in the XML file. I solved it by playing around in Lex.hs. I could 
check for the (ugly) solution...

> Yes, it is expected.  An ampersand indicates the start of a reference, 
> e.g. < or   If there is no semicolon to indicate the end of the 
> reference, then it is a parse error.  The XML specification is quite 
> clear that neither & nor < are valid standalone characters in an 
> attribute value.

Which is exactly the problem. The & is part of a reference, namely &euml;.

Regards,

Koen.


More information about the Haskell-Cafe mailing list