src/Tools/Haskell/XML.hs
changeset 69236 a75aab6d785b
parent 69234 2dec32c7313f
child 69280 e1d01b351724
     1.1 --- a/src/Tools/Haskell/XML.hs	Mon Nov 05 10:02:21 2018 +0100
     1.2 +++ b/src/Tools/Haskell/XML.hs	Mon Nov 05 11:29:11 2018 +0100
     1.3 @@ -27,16 +27,12 @@
     1.4  
     1.5  {- wrapped elements -}
     1.6  
     1.7 -xml_elemN = "xml_elem"
     1.8 -xml_nameN = "xml_name"
     1.9 -xml_bodyN = "xml_body"
    1.10 +wrap_elem (((a, atts), body1), body2) =
    1.11 +  Elem ("xml_elem", ("xml_name", a) : atts) (Elem ("xml_body", []) body1 : body2)
    1.12  
    1.13 -wrap_elem (((a, atts), body1), body2) =
    1.14 -  Elem (xml_elemN, (xml_nameN, a) : atts) (Elem (xml_bodyN, []) body1 : body2)
    1.15 -
    1.16 -unwrap_elem (Elem (name, (n, a) : atts) (Elem (name', atts') body1 : body2)) =
    1.17 -  if name == xml_elemN && n == xml_nameN && name' == xml_bodyN && null atts'
    1.18 -  then Just (((a, atts), body1), body2) else Nothing
    1.19 +unwrap_elem
    1.20 +  (Elem ("xml_elem", ("xml_name", a) : atts) (Elem ("xml_body", []) body1 : body2)) =
    1.21 +  Just (((a, atts), body1), body2)
    1.22  unwrap_elem _ = Nothing
    1.23  
    1.24