Function: nxml-parent-document-set
nxml-parent-document-set is an interactive and byte-compiled function
defined in nxml-mode.el.gz.
Signature
(nxml-parent-document-set PARENT-DOCUMENT)
Documentation
Set nxml-parent-document and inherit the DTD &c.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/nxml/nxml-mode.el.gz
(defun nxml-parent-document-set (parent-document)
"Set `nxml-parent-document' and inherit the DTD &c."
;; FIXME: this does not work.
;; the idea is that by inheriting some variables from the parent,
;; `rng-validate-mode' will validate entities declared in the parent.
;; alas, the most interesting variables (`rng-compile-table' et al)
;; are circular and cannot be printed even with `print-circle'.
(interactive "fParent document")
(let (dtd current-schema current-schema-file-name compile-table
ipattern-table last-ipattern-index)
(when (string= (file-truename parent-document)
(file-truename buffer-file-name))
(error "Parent document cannot be the same as the document"))
(with-current-buffer (find-file-noselect parent-document)
(setq dtd rng-dtd
current-schema rng-current-schema
current-schema-file-name rng-current-schema-file-name
compile-table rng-compile-table
ipattern-table rng-ipattern-table
last-ipattern-index rng-last-ipattern-index
parent-document buffer-file-name))
(setq rng-dtd dtd
rng-current-schema current-schema
rng-current-schema-file-name current-schema-file-name
rng-compile-table compile-table
rng-ipattern-table ipattern-table
rng-last-ipattern-index last-ipattern-index
nxml-parent-document parent-document)
(message "Set parent document to %s" parent-document)
(when rng-validate-mode
(rng-validate-while-idle (current-buffer)))))