[Haskell-cafe] Unescaping with HaXmL (or anything else!)

Anton van Straaten anton at appsolutions.com
Thu Mar 27 21:26:35 EDT 2008


I want to unescape an encoded XML or HTML string, e.g. converting " 
to the quote character, etc.

Since I'm using HaXml anyway, I tried using xmlUnEscapeContent with no 
luck, e.g. with HaXml 1.19.1:

let (CString _ s _) =
   head $ xmlUnEscapeContent stdXmlEscaper $
    [CString  False "This is a "quoted string"" ()] in s

The result is unchanged, i.e. "This is a "quoted string"".

Am I doing something wrong, or are my expectations wrong, or is this a bug?

Or, is there any other library that includes a simple unescape function 
for XML or HTML?

(The Network.URI module includes an unescape function, but that's 
specific to URIs, naturally.)

Anton



More information about the Haskell-Cafe mailing list