Commits

David Lazar committed c8f39ec

Fix bug in XML escaping: "<" was being escaped as "&amp;lt;" instead of "&lt;".

Comments (0)

Files changed (1)

 
 (* escape XML chars *)
 let escape_string str : string =
+    let str = Str.global_replace (Str.regexp "&") "&amp;" str in
     let str = Str.global_replace (Str.regexp "<") "&lt;" str in
     let str = Str.global_replace (Str.regexp ">") "&gt;" str in
-    let str = Str.global_replace (Str.regexp "&") "&amp;" str in
     let str = Str.global_replace (Str.regexp "'") "&apos;" str in
     let str = Str.global_replace (Str.regexp "\"") "&quot;" str in
     str