Created
December 12, 2011 12:46
-
-
Save raimohanska/1466986 to your computer and use it in GitHub Desktop.
Clean whitespace from XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Text.Regex.XMLSchema.String(match, sed) | |
clean :: String -> String | |
clean = sed (const "><") ">\\s*<" . trim | |
where trim = dropWhile whitespace . reverse . dropWhile whitespace . reverse | |
whitespace c = match "\\s" [c] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment