Function: rng-locate-schema-file

rng-locate-schema-file is a byte-compiled function defined in rng-loc.el.gz.

Signature

(rng-locate-schema-file &optional TYPE-ID)

Documentation

Return the file-name of the schema to use for the current buffer.

Return nil if no schema could be located. If TYPE-ID is non-nil, then locate the schema for this TYPE-ID.

Source Code

;; Defined in /usr/src/emacs/lisp/nxml/rng-loc.el.gz
(defun rng-locate-schema-file (&optional type-id)
  "Return the file-name of the schema to use for the current buffer.
Return nil if no schema could be located.
If TYPE-ID is non-nil, then locate the schema for this TYPE-ID."
  (let* ((rng-cached-document-element nil)
	 (schema
	  (if type-id
	      (cons type-id nil)
	    (rng-locate-schema-file-using rng-schema-locating-files)))
	 files type-ids)
    (while (consp schema)
      (setq files rng-schema-locating-files)
      (setq type-id (car schema))
      (setq schema nil)
      (when (member type-id type-ids)
	(error "Type-id loop for type-id `%s'" type-id))
      (setq type-ids (cons type-id type-ids))
      (while (and files (not schema))
	(setq schema
	      (rng-locate-schema-file-from-type-id type-id
						   (car files)))
	(setq files (cdr files))))
    (and schema
	 (rng-uri-file-name schema))))