Document Types > Document Types > Schema Overview > Specifying a Schema
  
Specifying a Schema
Documents can specify their schema using a default namespace declaration on the root element instead of a <!DOCTYPE> declaration. Arbortext Editor uses the namespace URI to locate the schema (.xsd or .dtd) and the associated document type directory. The namespace URI must be declared in a catalog using the URI catalog entry to map the namespace URI into a DTD or schema file. For example, a document beginning with:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
will use the xhtml document type if the URI mapping above appears in a catalog (as is the case with the Arbortext Editor default catalog). Similarly, the “Arbortext Very Simple XML Docbook Article” sample document beginning with:
<?xml version="1.0" encoding="utf-8"?>
<article xmlns="http://www.arbortext.com/namespace/doctypes/avsdocbook">
will use the XML schema avsdocbook.xsd due to the catalog entry:
URI "http://www.arbortext.com/namespace/doctypes/avsdocbook"
"avsdocbook.xsd"
Each namespace can have only one schema associated with it.
The document type can also be located by specifying schema location hints on the root element. Arbortext Editor supports both of the following attributes:
xsi:schemaLocation
and:
xsi:noNameSpaceSchemaLocation
If no target namespace is specified in the schema:
xsi:noNamespaceSchemaLocation
If the namespace is not resolved by a URI catalog entry, the location is used as the URI to search the catalog. If that location is not resolved, it is used as a system identifier.
Refer to XML Schema (www.w3.org/XML/Schema) for more information about the syntax for referencing schema definitions within an instance.