[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/xml.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/xml.el |
Date: |
Fri, 10 Jan 2003 03:33:41 -0500 |
Index: emacs/lisp/xml.el
diff -c emacs/lisp/xml.el:1.13 emacs/lisp/xml.el:1.14
*** emacs/lisp/xml.el:1.13 Sun Jan 5 20:10:25 2003
--- emacs/lisp/xml.el Fri Jan 10 03:33:41 2003
***************
*** 184,190 ****
;; beginning of a document)
((looking-at "<\\?")
(search-forward "?>" end)
! (skip-chars-forward " \t\n")
(xml-parse-tag end))
;; Character data (CDATA) sections, in which no tag should be interpreted
((looking-at "<!\\[CDATA\\[")
--- 184,190 ----
;; beginning of a document)
((looking-at "<\\?")
(search-forward "?>" end)
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
(xml-parse-tag end))
;; Character data (CDATA) sections, in which no tag should be interpreted
((looking-at "<!\\[CDATA\\[")
***************
*** 198,204 ****
(if parse-dtd
(setq dtd (xml-parse-dtd end))
(xml-skip-dtd end))
! (skip-chars-forward " \t\n")
(if dtd
(cons dtd (xml-parse-tag end))
(xml-parse-tag end))))
--- 198,204 ----
(if parse-dtd
(setq dtd (xml-parse-dtd end))
(xml-skip-dtd end))
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
(if dtd
(cons dtd (xml-parse-tag end))
(xml-parse-tag end))))
***************
*** 210,216 ****
((looking-at "</")
'())
;; opening tag
! ((looking-at "<\\([^/> \t\n]+\\)")
(goto-char (match-end 1))
(let* ((case-fold-search nil) ;; XML is case-sensitive.
(node-name (match-string 1))
--- 210,216 ----
((looking-at "</")
'())
;; opening tag
! ((looking-at "<\\([^/>[:space:]]+\\)")
(goto-char (match-end 1))
(let* ((case-fold-search nil) ;; XML is case-sensitive.
(node-name (match-string 1))
***************
*** 219,225 ****
pos)
;; is this an empty element ?
! (if (looking-at "/[ \t\n]*>")
(progn
(forward-char 2)
(nreverse (cons '("") children)))
--- 219,225 ----
pos)
;; is this an empty element ?
! (if (looking-at "/[[:space:]]*>")
(progn
(forward-char 2)
(nreverse (cons '("") children)))
***************
*** 230,236 ****
(forward-char 1)
;; Now check that we have the right end-tag. Note that this
;; one might contain spaces after the tag name
! (while (not (looking-at (concat "</" node-name "[ \t\n]*>")))
(cond
((looking-at "</")
(error (concat
--- 230,236 ----
(forward-char 1)
;; Now check that we have the right end-tag. Note that this
;; one might contain spaces after the tag name
! (while (not (looking-at (concat "</" node-name "[[:space:]]*>")))
(cond
((looking-at "</")
(error (concat
***************
*** 281,288 ****
Leaves the point on the first non-blank character after the tag."
(let ((attlist ())
name)
! (skip-chars-forward " \t\n")
! (while (looking-at "\\([a-zA-Z_:][-a-zA-Z0-9._:]*\\)[ \t\n]*=[ \t\n]*")
(setq name (intern (match-string 1)))
(goto-char (match-end 0))
--- 281,288 ----
Leaves the point on the first non-blank character after the tag."
(let ((attlist ())
name)
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
! (while (looking-at
"\\([a-zA-Z_:][-a-zA-Z0-9._:]*\\)[[:space:]]*=[[:space:]]*")
(setq name (intern (match-string 1)))
(goto-char (match-end 0))
***************
*** 298,304 ****
(push (cons name (match-string-no-properties 1)) attlist)
(goto-char (match-end 0))
! (skip-chars-forward " \t\n")
(if (> (point) end)
(error "XML: end of attribute list not found before end of region"))
)
--- 298,304 ----
(push (cons name (match-string-no-properties 1)) attlist)
(goto-char (match-end 0))
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
(if (> (point) end)
(error "XML: end of attribute list not found before end of region"))
)
***************
*** 318,331 ****
The point must be just before the starting tag of the DTD.
This follows the rule [28] in the XML specifications."
(forward-char (length "<!DOCTYPE"))
! (if (looking-at "[ \t\n]*>")
(error "XML: invalid DTD (excepting name of the document)"))
(condition-case nil
(progn
(forward-word 1) ;; name of the document
! (skip-chars-forward " \t\n")
(if (looking-at "\\[")
! (re-search-forward "\\][ \t\n]*>" end)
(search-forward ">" end)))
(error (error "XML: No end to the DTD"))))
--- 318,331 ----
The point must be just before the starting tag of the DTD.
This follows the rule [28] in the XML specifications."
(forward-char (length "<!DOCTYPE"))
! (if (looking-at "[[:space:]]*>")
(error "XML: invalid DTD (excepting name of the document)"))
(condition-case nil
(progn
(forward-word 1) ;; name of the document
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
(if (looking-at "\\[")
! (re-search-forward "\\][[:space:]]*>" end)
(search-forward ">" end)))
(error (error "XML: No end to the DTD"))))
***************
*** 333,339 ****
"Parse the DTD that point is looking at.
The DTD must end before the position END in the current buffer."
(forward-char (length "<!DOCTYPE"))
! (skip-chars-forward " \t\n")
(if (looking-at ">")
(error "XML: invalid DTD (excepting name of the document)"))
--- 333,339 ----
"Parse the DTD that point is looking at.
The DTD must end before the position END in the current buffer."
(forward-char (length "<!DOCTYPE"))
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
(if (looking-at ">")
(error "XML: invalid DTD (excepting name of the document)"))
***************
*** 343,349 ****
type element end-pos)
(goto-char (match-end 0))
! (skip-chars-forward " \t\n")
;; External DTDs => don't know how to handle them yet
(if (looking-at "SYSTEM")
--- 343,349 ----
type element end-pos)
(goto-char (match-end 0))
! (goto-char (- (re-search-forward "[^[:space:]]") 1))
;; External DTDs => don't know how to handle them yet
(if (looking-at "SYSTEM")
***************
*** 354,366 ****
;; Parse the rest of the DTD
(forward-char 1)
! (while (and (not (looking-at "[ \t\n]*\\]"))
(<= (point) end))
(cond
;; Translation of rule [45] of XML specifications
((looking-at
! "[\t \n]*<!ELEMENT[ \t\n]+\\([a-zA-Z0-9.%;]+\\)[ \t\n]+\\([^>]+\\)>")
(setq element (intern (match-string-no-properties 1))
type (match-string-no-properties 2))
--- 354,366 ----
;; Parse the rest of the DTD
(forward-char 1)
! (while (and (not (looking-at "[[:space:]]*\\]"))
(<= (point) end))
(cond
;; Translation of rule [45] of XML specifications
((looking-at
!
"[[:space:]]*<!ELEMENT[[:space:]]+\\([a-zA-Z0-9.%;]+\\)[[:space:]]+\\([^>]+\\)>")
(setq element (intern (match-string-no-properties 1))
type (match-string-no-properties 2))
***************
*** 368,380 ****
;; Translation of rule [46] of XML specifications
(cond
! ((string-match "^EMPTY[ \t\n]*$" type) ;; empty declaration
(setq type 'empty))
! ((string-match "^ANY[ \t\n]*$" type) ;; any type of contents
(setq type 'any))
! ((string-match "^(\\(.*\\))[ \t\n]*$" type) ;; children ([47])
(setq type (xml-parse-elem-type (match-string-no-properties 1 type))))
! ((string-match "^%[^;]+;[ \t\n]*$" type) ;; substitution
nil)
(t
(error "XML: Invalid element type in the DTD")))
--- 368,380 ----
;; Translation of rule [46] of XML specifications
(cond
! ((string-match "^EMPTY[[:space:]]*$" type) ;; empty declaration
(setq type 'empty))
! ((string-match "^ANY[[:space:]]*$" type) ;; any type of contents
(setq type 'any))
! ((string-match "^(\\(.*\\))[[:space:]]*$" type) ;; children ([47])
(setq type (xml-parse-elem-type (match-string-no-properties 1 type))))
! ((string-match "^%[^;]+;[[:space:]]*$" type) ;; substitution
nil)
(t
(error "XML: Invalid element type in the DTD")))
***************
*** 416,422 ****
(mapcar 'xml-parse-elem-type
(split-string elem ","))))
)))
! (if (string-match "[ \t\n]*\\([^+*?]+\\)\\([+*?]?\\)" string)
(setq elem (match-string 1 string)
modifier (match-string 2 string))))
--- 416,422 ----
(mapcar 'xml-parse-elem-type
(split-string elem ","))))
)))
! (if (string-match "[[:space:]]*\\([^+*?]+\\)\\([+*?]?\\)" string)
(setq elem (match-string 1 string)
modifier (match-string 2 string))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/xml.el,
Juanma Barranquero <=