Variable: org-odt-schema-dir

org-odt-schema-dir is a customizable variable defined in ox-odt.el.gz.

Value

nil

Documentation

Directory that contains OpenDocument schema files.

This directory contains:
1. rnc files for OpenDocument schema
2. a "schemas.xml" file that specifies locating rules needed
   for auto validation of OpenDocument XML files.

Use the customize interface to set this variable. This ensures that rng-schema-locating-files is updated and auto-validation of OpenDocument XML takes place based on the value rng-nxml-auto-validate-flag.

The default value of this variable varies depending on the version of org in use and is initialized from org-odt-schema-dir-list. The OASIS schema files are available only in the org's private git repository. It is *not* bundled with GNU ELPA tar or standard Emacs distribution.

This variable was added, or its default value changed, in Emacs 24.1.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
(defcustom org-odt-schema-dir
  (cl-find-if
   (lambda (dir)
     (and dir
	  (file-expand-wildcards
	   (expand-file-name "od-manifest-schema*.rnc" dir))
	  (file-expand-wildcards (expand-file-name "od-schema*.rnc" dir))
	  (file-readable-p (expand-file-name "schemas.xml" dir))))
   org-odt-schema-dir-list)
  "Directory that contains OpenDocument schema files.

This directory contains:
1. rnc files for OpenDocument schema
2. a \"schemas.xml\" file that specifies locating rules needed
   for auto validation of OpenDocument XML files.

Use the customize interface to set this variable.  This ensures
that `rng-schema-locating-files' is updated and auto-validation
of OpenDocument XML takes place based on the value
`rng-nxml-auto-validate-flag'.

The default value of this variable varies depending on the
version of org in use and is initialized from
`org-odt-schema-dir-list'.  The OASIS schema files are available
only in the org's private git repository.  It is *not* bundled
with GNU ELPA tar or standard Emacs distribution."
  :type '(choice
	  (const :tag "Not set" nil)
	  (directory :tag "Schema directory"))
  :version "24.1"
  :set
  (lambda (var value)
    "Set `org-odt-schema-dir'.
Also add it to `rng-schema-locating-files'."
    (let ((schema-dir value))
      (set-default-toplevel-value var
	   (if (and
		(file-expand-wildcards
		 (expand-file-name "od-manifest-schema*.rnc" schema-dir))
		(file-expand-wildcards
		 (expand-file-name "od-schema*.rnc" schema-dir))
		(file-readable-p
		 (expand-file-name "schemas.xml" schema-dir)))
	       schema-dir
	     (when value
	       (message "Error (ox-odt): %s has no OpenDocument schema files"
			value))
	     nil)))
    (when org-odt-schema-dir
      (eval-after-load 'rng-loc
	'(add-to-list 'rng-schema-locating-files
		      (expand-file-name "schemas.xml"
					org-odt-schema-dir))))))