[Haskell-cafe] [tagsoup] is it the expected behaviour ?

Ketil Malde ketil at malde.org
Mon May 19 06:44:32 EDT 2008

Fernand <quarantedeux42 at yahoo.fr> writes:

> Experimenting with tagsoup (I'm using GHC 6.8.2 and tagsoup-0.6), I
> found something which appears to me as strange behaviour : when
> parsing tag's attributes that have spaces enclosing the "=" sign,
> tagsoup seems to interpret these as empty attributes' names and
> values. For instance (notice the spaces enclosing the equal sign) :

I don't think that is legal XML. The definitions of STag and Attribute
from http://www.w3.org/TR/xml11/#NT-STag are:

  [40]   STag	   ::= 	'<' Name (S  Attribute)* S? '>'
  [41]   Attribute ::= 	Name Eq AttValue 

And 'S' represents one or more whitespace characters, so it seems
clear that they are not allowed between Name, Eq, and AttValue.

Whether this is the right behavior for TagSoup, which is styled as a
fast-and-loose XML/HTML processor, is another matter.

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list