Function: xml-parse-tag
xml-parse-tag is a byte-compiled function defined in xml.el.gz.
Signature
(xml-parse-tag &optional PARSE-DTD PARSE-NS)
Documentation
Parse the tag at point.
If PARSE-DTD is non-nil, the DTD of the document, if any, is parsed and
returned as the first element in the list.
If PARSE-NS is non-nil, expand QNAMES; for further details, see
xml-parse-region.
Return one of:
- a list : the matching node
- nil : the point is not looking at a tag.
- a pair : the first element is the DTD, the second is the node.
Source Code
;; Defined in /usr/src/emacs/lisp/xml.el.gz
(defun xml-parse-tag (&optional parse-dtd parse-ns)
"Parse the tag at point.
If PARSE-DTD is non-nil, the DTD of the document, if any, is parsed and
returned as the first element in the list.
If PARSE-NS is non-nil, expand QNAMES; for further details, see
`xml-parse-region'.
Return one of:
- a list : the matching node
- nil : the point is not looking at a tag.
- a pair : the first element is the DTD, the second is the node."
(let* ((case-fold-search nil)
;; Prevent entity definitions from changing the defaults
(xml-entity-alist xml-entity-alist)
(xml-parameter-entity-alist xml-parameter-entity-alist)
(buf (current-buffer))
(pos (point)))
(with-temp-buffer
(with-syntax-table xml-syntax-table
(insert-buffer-substring-no-properties buf pos)
(goto-char (point-min))
(xml-parse-tag-1 parse-dtd parse-ns)))))