>XML Catalogs in Eclipse

>There is a little known feature in eclipse, that can make editing XML files much easier if they have a grammar to go with them. In particular if there is a DTD or XML Schema. The WTP source editing project provides a basic implementation of the OASIS XML Catalog specification. There is work going on to implement full support for XML Catalog 1.1, but the current implementation is pretty useful as it is.

According to Wikipedia, “The XML catalog is a document describing a mapping between external entity references and locally-cached equivalents.”. It itself is an xml file format. The advantage of using XML Catalogs with in the WTP XML Editor is that you can define a particular namespace and have it resolve the appropriate grammar. This then can give you content assistance and validation of the document you are editing.

There is an eclipse wikipedia entry that provides more information. I use the XML Catalog in WTP to provide content assistance for XInclude, XSL-FO, DocBook, DITA, and other xml formats. If it has a grammar (DTD or Schema) you can get some good content assistance help for the various elements and attributes that the grammar has. It is also useful for working with various industry B2B standards as well.

For adopters, eclipse does provide an extension point so that you can add your own grammars automatically to the existing catalog. Thus allowing the XML editor to already know about your grammars and providing the same benefit but more control as allowing the user to manually add it themselves.

Advertisements
This entry was posted in eclipse, xml. Bookmark the permalink.

2 Responses to >XML Catalogs in Eclipse

  1. stug23 says:

    >In addition to using XML Catalogs to support editing of XML instance documents, it would be nice if they could also be used to support XML schema that is to be imported into another XML Schema document.I don’t know if the spec addresses this but it would be useful in a context wherein a repeating, common schema is referenced in other schemas such as for a web service request message.

  2. >Yes, stug23, the Eclipse Catalog support also supports this.In fact, I’ve added almost complete support for Catalog 1.1 in bug 112284, but since it has to go through IP review, I’m not sure it will make it into WTP 3.1 (but I’m still keeping my fingers crossed…)Proper XML Catalog 1.1 support makes it a lot easier to deal with large collections of schemas with a “political” namespace, using the rewriteSystem and the like. The Danish OIOXML schema collection is one such case.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s