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:
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.
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
uses schema
x.”
y
When emacs opens your file, it looks through the schema locating files in order until it finds a match.