6 Locating a schema

nXML mode has a configurable set of rules to locate a schema for the file being edited. The rules are contained in one or more schema locating files, which are XML documents.

The variable ‘rng-schema-locating-files’ specifies the list of the file-names of schema locating files that nXML mode should use. The order of the list is significant: when file x occurs in the list before file y then rules from file x have precedence over rules from file y. A filename specified in ‘rng-schema-locating-files’ may be relative. If so, it will be resolved relative to the document for which a schema is being located. It is not an error if relative file-names in ‘rng-schema-locating-files’ do not exist. You can use M-x customize-variable RET rng-schema-locating-files RET to customize the list of schema locating files.

By default, ‘rng-schema-locating-files’ list has two members: ‘schemas.xml’, and ‘dist-dir/schema/schemas.xml’ where ‘dist-dir’ is the directory containing the nXML distribution. The first member will cause nXML mode to use a file ‘schemas.xml’ in the same directory as the document being edited if such a file exist. The second member contains rules for the schemas that are included with the nXML distribution.