;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode
-;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: XML, RelaxNG
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(require 'rng-loc)
(defcustom rng-nxml-auto-validate-flag t
- "*Non-nil means automatically turn on validation with nxml-mode."
+ "Non-nil means automatically turn on validation with nxml-mode."
:type 'boolean
:group 'relax-ng)
("http://www.w3.org/1999/02/22-rdf-syntax-ns#" . "rdf")
("http://www.w3.org/1999/xlink" . "xlink")
("http://www.w3.org/2001/XmlSchema" . "xsd")
- ("http://www.w3.org/2001/XMLSchema-instance" . "xsi"))
- "*Alist of namespaces vs preferred prefixes."
+ ("http://www.w3.org/2001/XMLSchema-instance" . "xsi")
+ ("http://purl.org/dc/elements/1.1/" . "dc")
+ ("http://purl.org/dc/terms/" . "dcterms"))
+ "Alist of namespaces vs preferred prefixes."
:type '(repeat (cons :tag "With"
(string :tag "this namespace URI")
(string :tag "use this prefix")))
(defun rng-set-state-after (&optional pos)
"Set the state for after parsing the first token with endpoint >= POS.
This does not change the xmltok state or point. However, it does
-set `xmltok-dtd'. Returns the position of the end of the token."
+set `xmltok-dtd'. Returns the position of the end of the token."
(unless pos (setq pos (point)))
(when (< rng-validate-up-to-date-end pos)
(message "Parsing...")
(rng-process-start-tag 'stop)
(rng-find-undeclared-prefixes)
t)))))
-
+
(defun rng-find-undeclared-prefixes ()
;; Start with the newly effective namespace declarations.
;; (Includes declarations added during recovery.)
(list (cdr name))))
rng-complete-target-names)))
'string<))))
-
+
(defun rng-get-preferred-unused-prefix (ns)
(let ((ns-prefix (assoc (symbol-name ns) rng-preferred-prefix-alist))
iter prefix)
(provide 'rng-nxml)
-;; arch-tag: bec0d6ed-6be1-4540-9c2c-6f56e8e55d8b
;;; rng-nxml.el ends here