src/Pure/General/xml.ML
changeset 14865 8b9a372b3e90
parent 14863 49afb368f4be
child 14910 f145696d4bb5
--- a/src/Pure/General/xml.ML	Wed Jun 02 17:35:08 2004 +0200
+++ b/src/Pure/General/xml.ML	Fri Jun 04 11:51:31 2004 +0200
@@ -89,14 +89,9 @@
     implode) --| scan_lit "]]>";
 
 val parse_att =
-  Symbol.scan_id --| scan_whspc --| $$ "=" --| scan_whspc --| $$ "\"" --
-  (Scan.repeat (Scan.unless ($$ "\"")
-    (scan_special || Scan.one Symbol.not_eof)) >> implode) --| $$ "\"";
-
-val parse_att2 = 
-  Symbol.scan_id --| scan_whspc --| $$ "=" --| scan_whspc --| $$ "'" --
-  (Scan.repeat (Scan.unless ($$ "'")
-    (scan_special || Scan.one Symbol.not_eof)) >> implode) --| $$ "'";
+  Symbol.scan_id --| scan_whspc --| $$ "=" --| scan_whspc --
+  (($$ "\"" || $$ "'") :-- (fn s => (Scan.repeat (Scan.unless ($$ s)
+    (scan_special || Scan.one Symbol.not_eof)) >> implode) --| $$ s) >> snd);
 
 val parse_comment = scan_lit "<!--" --
   Scan.repeat (Scan.unless (scan_lit "-->") (Scan.one Symbol.not_eof)) --
@@ -118,7 +113,7 @@
 
 and parse_elem xs =
   ($$ "<" |-- Symbol.scan_id --
-    Scan.repeat (scan_whspc |-- (parse_att || parse_att2)) --| scan_whspc :-- (fn (s, _) =>
+    Scan.repeat (scan_whspc |-- parse_att) --| scan_whspc :-- (fn (s, _) =>
       !! (err "Expected > or />")
         (scan_lit "/>" >> K []
          || $$ ">" |-- parse_content --|