1 ;;; rng-dt.el --- datatype library interface for RELAX NG
3 ;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
6 ;; Keywords: XML, RelaxNG
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
31 (defvar rng-dt-error-reporter nil
)
33 (defun rng-dt-error (string &rest objs
)
34 (if rng-dt-error-reporter
35 (apply rng-dt-error-reporter
(cons string objs
))
38 (defvar rng-dt-namespace-context-getter nil
39 "A list used by datatype libraries to expand names. The car of the
40 list is a symbol which is the name of a function. This function is
41 applied to the cdr of the list. The function must return a list whose
42 car is the default namespace and whose cdr is an alist of (PREFIX
43 . NAMESPACE) pairs, where PREFIX is a string and NAMESPACE is a
44 symbol. This must be dynamically bound before calling a datatype
47 (defsubst rng-dt-make-value
(dt str
)
48 (apply (car dt
) (cons str
(cdr dt
))))
50 (defun rng-dt-builtin-compile (name params
)
51 (cond ((eq name
'string
)
54 (rng-dt-error "The string datatype does not take any parameters")))
57 '(t rng-collapse-space
)
58 (rng-dt-error "The token datatype does not take any parameters")))
60 (rng-dt-error "There is no built-in datatype %s" name
))))
62 (put (rng-make-datatypes-uri "") 'rng-dt-compile
'rng-dt-builtin-compile
)
66 ;; arch-tag: 1dca90f1-8dae-4dd4-b61f-fade4452c014
67 ;;; rng-dt.el ends here