How To: Use Trang with Catalog-Based Resolution (DTD-to-Schema)

I'm trying to use Trang through Oxygen to create flat schemas from my local shells and specializations. I immediately ran into the problem that all my stuff depends on catalogs and it looks like Trang isn't using the catalogs configured in the main editor. Is there an easy way to hook in the catalogs? Thanks, Eliot -- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 610.631.6770 www.reallysi.com www.rsuitecms.com

Hello, The XML catalogs set in oXygen is used correctly by Trang for converting XML inputs but not for converting DTD ones because Trang uses a custom non JAXP parser for parsing a DTD input, that is com.thaiopensource.xml.dtd.parse.DtdParserImpl which uses a custom non JAXP resolver. You can modify this DTD parser class by setting your own custom entity resolver which uses the oXygen catalog resolver class (ro.sync.xml.catalogresolver.CatalogResolverFactory.CatalogEntityResolver available in oxygen.jar) instead of setting an instance of com.thaiopensource.xml.dtd.app.UriEntityManager on the line 143 of com.thaiopensource.relaxng.input.dtd.DtdInputFormat which is an internal Trang class. On line 143 of DtdInputFormat: Dtd dtd = new DtdParserImpl().parse(uri, new UriEntityManager()); you should replace UriEntityManager with your own resolver, for example: Dtd dtd = new DtdParserImpl().parse(uri, new CustomCatalogResolverManager()); To replace Trang's version of DtdInputFormat with your modified version just package your version and your custom entity resolver in a jar file, place this jar file in the folder [oXygen-install-folder]/lib/endorsed and restart oXygen. We will add such a custom entity resolver for Trang's DTD inputs in a future version of oXygen but it should not be difficult to implement it and set it yourself in the meantime. Regards, Sorin Eliot Kimber wrote:
I'm trying to use Trang through Oxygen to create flat schemas from my local shells and specializations. I immediately ran into the problem that all my stuff depends on catalogs and it looks like Trang isn't using the catalogs configured in the main editor.
Is there an easy way to hook in the catalogs?
Thanks,
Eliot

Sorin Ristache wrote:
We will add such a custom entity resolver for Trang's DTD inputs in a future version of oXygen but it should not be difficult to implement it and set it yourself in the meantime.
Cool, thanks. For my immediate use I just copied all the DITA declarations and my local shells into a single directory, but a more general solution will be welcome. Cheers, Eliot -- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 610.631.6770 www.reallysi.com www.rsuitecms.com
participants (2)
-
Eliot Kimber
-
Sorin Ristache