The association can specify a relative file path or a URL of the schema. The advantage of
relative file path is that you can configure the schema at file level instead of
document type level.
Select the
Associate schema action from the menu or the Document toolbar to select the schema that
will be associated with the XML document. The Associate Schema dialog
box is displayed:
Figure: The Associate Schema Dialog Box
The available options are:
-
URL - Contains a predefined set of schemas that are used more often
and it also keeps a history of the last used schemas. The URL must point to the schema
file which can be loaded from the local disk or from a remote server through HTTP(S),
FTP(S) or a custom protocol.
-
Schema type - Selected automatically from the list of possible
types in the Schema type combo box (XML Schema, DTD, Relax NG,
Relax NG Compact, Schematron, NVDL) based on the extension of the schema file that was
entered in the URL field.
-
Public ID - Specify a public ID if you have selected a DTD.
-
Add additional association for embedded schematron rules - If you
have selected XML Schema or Relax NG schemas with embedded Schematron rules, enable this
option.
-
Use path relative to file location - Enable this option if the XML
instance document and the associated schema contain relative paths. The location of the
schema file is inserted in the XML instance document as a relative file path. This
practice allows you, for example, to share these documents with other users, without
running into problems caused by different project locations on physical disk.
-
Keep existing schema associations - Enable this option to keep the associations of the currently edited document with a
Schema when you associate a new one.
The association with an XML Schema is added as an attribute of the root element. The
Associate schema action adds a:
- xsi:schemaLocation attribute, if the root element of the
document sets a default namespace with an xmlns attribute.
- or a xsi:noNamespaceSchemaLocation attribute, if the root
element does not set a default namespace.
The association with a DTD is added as a DOCTYPE declaration. The
association with a Relax NG , Schematron or NVDL schema is added as xml-model processing instruction.