@@ -525,17 +525,16 @@ normalizeTree = everywhere (mkT go)
525525 go (Text (CData CDataText s1 z):Text (CData CDataText s2 _):xs) =
526526 Text (CData CDataText (s1 ++ s2) z):xs
527527 go (Text (CData CDataText s1 z):CRef r:xs) =
528− Text (CData CDataText (s1 ++ [c]) z):xs
529− where c = maybe '?' id (lookupEntity r)
528+ Text (CData CDataText (s1 ++ convertEntity r) z):xs
530529 go (CRef r:Text (CData CDataText s1 z):xs) =
531− Text (CData CDataText ([c] ++ s1) z):xs
532− where c = maybe '?' id (lookupEntity r)
530+ Text (CData CDataText (convertEntity r ++ s1) z):xs
533531 go (CRef r1:CRef r2:xs) =
534− Text (CData CDataText [c1,c2] Nothing):xs
535− where c1 = maybe '?' id (lookupEntity r1)
536− c2 = maybe '?' id (lookupEntity r2)
532+ Text (CData CDataText (convertEntity r1 ++ convertEntity r2) Nothing):xs
537533 go xs = xs
538534
535+convertEntity :: String -> String
536+convertEntity e = maybe (map toUpper e) (:[]) (lookupEntity e)
537+
539538-- convenience function to get an attribute value, defaulting to ""
540539attrValue :: String -> Element -> String
541540attrValue attr elt =