Next / Previous / Contents / TCC Help System / NM Tech homepage

3.  How emacs finds your schema

emacs has to know where your schema lives so that it can help you build and maintain a valid document. This is a two-stage process:

  1. emacs has an internal variable named rng-schema-locating-files that tells it all the places to search for schema locating files. This variable's default value is ('schemas.xml', 'DIST-DIR/schema/schemas.xml'), where DIST-DIR is the distribution directory where nxml is installed.

    The schemas.xml file in the distribution directory handles many of the common cases such as XSLT files or DocBook documents.

    You can also have a schemas.xml file in the same directory as the document you are working on. This file is also a schema locating file.

  2. Each schema locating file specifies rules for associating files with schemas. The rules can use the file's extension (such as .xsl) or the file's root element (such as article) to infer the correct schema. If all else fails, it can simply specify file x uses schema y.”

When emacs opens your file, it looks through the schema locating files in order until it finds a match.