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.
Go to menu or click the
Associate schema
toolbar button to select the schema that will be associated with the XML document. The
following dialog is displayed:
The Associate Schema Dialog
The
following options are available:
- 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).
- 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.
- Embedded schematron rules - if you have selected XML Schema or
Relax NG schemas with embedded Schematron rules, enable this option.
- Use relative paths - 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.
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.