Am 19.07.2012 15:26, schrieb Christian Maeder:
Am 19.07.2012 15:14, schrieb Christian Maeder:
Am 19.07.2012 14:53, schrieb C K Kashyap:
innerXML = do
          x <- (try xml <|> gettext)
          return x

Omit "try" (and return).
xml always starts with "<" whereas gettext never does.

I was wrong, you do not want to swallow an endTag as openTag.

openTag should start with:
     try $ char '<' >> notFollowedBy (char '/')

and endTag should start with:
         try $ string "</"

Strictly, the try in endTag is not necessary (only in openTag)

C.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to