@@ -55,17 +55,9 @@ escapeCharForXML x = case x of
5555 '"' -> """
5656 c -> [c]
5757
58−-- | True if the character needs to be escaped.
59−needsEscaping :: Char -> Bool
60−needsEscaping c = c `elem` "&<>\""
61−
6258-- | Escape string as needed for XML. Entity references are not preserved.
6359escapeStringForXML :: String -> String
64−escapeStringForXML "" = ""
65−escapeStringForXML str =
66− case break needsEscaping str of
67− (okay, "") -> okay
68− (okay, (c:cs)) -> okay ++ escapeCharForXML c ++ escapeStringForXML cs
60+escapeStringForXML = concatMap escapeCharForXML
6961
7062-- | Return a text object with a string of formatted XML attributes.
7163attributeList :: [(String, String)] -> Doc