Function: rng-xsd-compile
rng-xsd-compile is an autoloaded and byte-compiled function defined in
rng-xsd.el.gz.
Signature
(rng-xsd-compile NAME PARAMS)
Documentation
Provide W3C XML Schema as a RELAX NG datatypes library.
NAME is a symbol giving the local name of the datatype. PARAMS is a
list of pairs (PARAM-NAME . PARAM-VALUE) where PARAM-NAME is a symbol
giving the name of the parameter and PARAM-VALUE is a string giving
its value. If NAME or PARAMS are invalid, it calls rng-dt-error
passing it arguments in the same style as format; the value from
rng-dt-error will be returned. Otherwise, it returns a list. The
first member of the list is t if any string is a legal value for the
datatype and nil otherwise. The second argument is a symbol; this
symbol will be called as a function passing it a string followed by
the remaining members of the list. The function must return an object
representing the value of the datatype that was represented by the
string, or nil if the string is not a representation of any value.
The object returned can be any convenient non-nil value, provided
that, if two strings represent the same value, the returned objects
must be equal.
Source Code
;; Defined in /usr/src/emacs/lisp/nxml/rng-xsd.el.gz
;;;###autoload
(defun rng-xsd-compile (name params)
"Provide W3C XML Schema as a RELAX NG datatypes library.
NAME is a symbol giving the local name of the datatype. PARAMS is a
list of pairs (PARAM-NAME . PARAM-VALUE) where PARAM-NAME is a symbol
giving the name of the parameter and PARAM-VALUE is a string giving
its value. If NAME or PARAMS are invalid, it calls `rng-dt-error'
passing it arguments in the same style as format; the value from
`rng-dt-error' will be returned. Otherwise, it returns a list. The
first member of the list is t if any string is a legal value for the
datatype and nil otherwise. The second argument is a symbol; this
symbol will be called as a function passing it a string followed by
the remaining members of the list. The function must return an object
representing the value of the datatype that was represented by the
string, or nil if the string is not a representation of any value.
The object returned can be any convenient non-nil value, provided
that, if two strings represent the same value, the returned objects
must be equal."
(let ((convert (get name 'rng-xsd-convert)))
(if (not convert)
(rng-dt-error "There is no XSD datatype named %s" name)
(rng-xsd-compile1 name params convert))))