How to change catalog file dynamically?

tmakita
Posts: 69
Joined: Fri Apr 08, 2011 7:58 am

How to change catalog file dynamically?

Post by tmakita » Mon Oct 01, 2012 6:51 am

Hi! Forum members,

I have some users who use DITA with specialization.

I usually receive the test data or error data for investigation based on each specialization DTDs. In this case the problem occurs in catalog file. I must change catalog file for each user because the CMS bender modifies the common OASIS dtd (or .mod) file to add CMS special attributes.

In the first I added following line at the end of [oXygen install dir]\frameworks\dita\DITA-OT\catalog-dita.xml.

<nextCatalog xml:base="file:///D:/DITA-OT1.5.3/dtd_CMS/" catalog="catalog.xml"></nextCatalog>

However if I opened the test data from the relevant user by oXygen XML Author, the editor displays the DTD error. So finally I edited [oXygen install dir]\frameworks\dita\DITA-OT\catalog-dita.xml only contains the above line. Then the test data became valid and I could safely edit the test data.

But it is very troublesome job to change the catalog file by the user data. Is there any convenient way to switch catalog file on the fly?

Regards,

Toshihiko Makita
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/

Radu
Posts: 6398
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to change catalog file dynamically?

Post by Radu » Mon Oct 01, 2012 12:07 pm

Hi,

So you have some kind of DITA specialization which declares extra attributes, right?
Usually a DITA specialization comes with custom DTD PUBLIC IDs. This is done especially to avoid the problem you reported, that your specialization DTDs are ignored because you have added the path to the other catalog as last in the DITA catalog.

The DITA 1.2 specification:

http://docs.oasis-open.org/dita/v1.2/os ... cType.html

states:
In particular, for document type shells not created by OASIS, the public identifier or URN for the document type shell must not indicate OASIS as the owner and should reflect the owner or creator of the document type shell. For example, if example.com creates a copy of the topic.dtd document type shell for its own use, an appropriate public identifier would be "-//example.com//DTD DITA Topic//EN", where "example.com" is the owner identifier component of the public identifier. An appropriate URN would be "urn:example.com:names:dita:xsd:topic.xsd".
Did you modify the PUBLIC IDs of your specialization? If not, you could try to add the nextCatalog as the first entry in the file.
Is there any convenient way to switch catalog file on the fly?
What do you mean? The DITA Open Toolkit publishing looks only in the catalog-dita.xml. In Oxygen for editing you can specify additional XML Catalogs in the XML / XML Catalog preferences page.

But the proper way to build DITA specializations is to have custom public IDs and then to pack the specialization as a DITA OT plugin which can be integrated by each user in the DITA OT they are using.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

tmakita
Posts: 69
Joined: Fri Apr 08, 2011 7:58 am

Re: How to change catalog file dynamically?

Post by tmakita » Tue Oct 02, 2012 4:26 pm

Dear Radu,

Yes, you are absolutely right.

However the CMS vender modified the files that have OASIS public identifier. So if I add nextCatalog as the first entry of catalog-dita.xml, the DTD confliction occurs!

As a result I *MUST* remove all the existing catalog entries and inserted the nextCatalog that point to the specialization catalog entry only.

I know that it is not based on the specialization guideline. But the DTD is finally controlled by the CMS vender. So I have no way to prevent it.

Regards,

Toshihiko Makita
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/

Radu
Posts: 6398
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to change catalog file dynamically?

Post by Radu » Tue Oct 02, 2012 5:11 pm

Hi Toshihiko,

I understand.

We have some Java API which allows developers to add a priority resolver for public and system IDs:

Code: Select all

ro.sync.exml.workspace.api.util.XMLUtilAccess.addPriorityEntityResolver(EntityResolver)
So a possibility would be to build an Oxygen plugin using our Plugins SDK:

http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins

which would somehow prefer your DTDs over the ones in the DITA catalog-dita.xml.

This would probably work when editing XML files from the CMS but it still would not work when publishing using the DITA OT because the DITA OT ANT process only looks at the catalog-dita.xml.

If you have a Java developer available and are interesting in building such a plugin for Oxygen I could try to give you additional details.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

tmakita
Posts: 69
Joined: Fri Apr 08, 2011 7:58 am

Re: How to change catalog file dynamically?

Post by tmakita » Thu Oct 04, 2012 7:29 am

Dear Radu,

Thank you for your information.
I appreciate your help.

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/

Post Reply