Function: xmltok-merge-attributes

xmltok-merge-attributes is a byte-compiled function defined in xmltok.el.gz.

Signature

(xmltok-merge-attributes)

Documentation

Return a list merging xmltok-attributes and xmltok-namespace-attributes.

The members of the merged list are in order of occurrence in the document. The list may share list structure with xmltok-attributes and xmltok-namespace-attributes.

Source Code

;; Defined in /usr/src/emacs/lisp/nxml/xmltok.el.gz
(defun xmltok-merge-attributes ()
  "Return a list merging `xmltok-attributes' and `xmltok-namespace-attributes'.
The members of the merged list are in order of occurrence in the
document.  The list may share list structure with `xmltok-attributes'
and `xmltok-namespace-attributes'."
  (cond ((not xmltok-namespace-attributes)
	 xmltok-attributes)
	((not xmltok-attributes)
	 xmltok-namespace-attributes)
	(t
	 (let ((atts1 xmltok-attributes)
	       (atts2 xmltok-namespace-attributes)
	       merged)
	   (while (and atts1 atts2)
	     (cond ((< (xmltok-attribute-name-start (car atts1))
		       (xmltok-attribute-name-start (car atts2)))
		    (setq merged (cons (car atts1) merged))
		    (setq atts1 (cdr atts1)))
		   (t
		    (setq merged (cons (car atts2) merged))
		    (setq atts2 (cdr atts2)))))
	   (setq merged (nreverse merged))
	   (cond (atts1 (setq merged (nconc merged atts1)))
		 (atts2 (setq merged (nconc merged atts2))))
	   merged))))