An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key
XML Catalog entries can be used in various situations. For example, you are working on an XML file on your main desktop computer and point its schemaLocation towards a schema called c:\MySchema.xsd. You then save it to your laptop computer so you can work on it later. When you open the file on your laptop, however, you encounter a problem - the XML editor cannot find the MySchema.xsd schema because it is actually installed on your D drive. You will have to edit the schemaLocation to point to d:\MySchema.xsd. When you have finished editing the XML file and are ready to publish it on the Web, you will need to edit the URI again so that it points to a resource that is accessible on the Web. By now, the problem is obvious. A URI used within an XML file is not as portable as you would like it to be. To avoid making frequent changes to your XML document, you can use the XML Catalog.
An XML Catalog entry is used by an XML processor when resolving entity references. You can provide rules to the catalog to specify how entities should be resolved. If you consider the preceding example, you could specify a rule that redirects an Internet resource reference (for example, "http://www.ibm.com/published-schemas/MySchema.xsd") so that it points to a resource on the developer's local machine (for example, "file:///C:/MySchema.xsd"). Now, instead of frequently editing XML documents to update the URIs or locations (especially when there are many documents in your project), you only need to update a single rule in your XML Catalog.
The following instructions were written for the Resource perspective, but they will also work in many other perspectives.
To add an entry to the XML Catalog, follow these steps:
You can also export and import XML Catalog information:
To export, click File > Export and select XML > XML Catalog. You will be prompted to select a project and provide a file name to store your catalog entries in an .xmlcatalog file, which can be opened from the Navigator view. Since your catalog entries are stored in an .xmlcatalog file, you can check them in and out and share them like any other project resource.
To import, click File > Import and select XML > XML Catalog. Then specify the file that will be used to load the XML Catalog settings. When you import a .xmlcatalog file, any entries in it will be loaded into the XML Catalog (and any existing entries will be overwritten).