Page 1 of 1

Can I have a public DTD with a catalog entry fallback

Posted: Tue Nov 01, 2011 9:53 pm
by jorahood
I have DITA shell DTDs in a project that I want to point to at a url in a PUBLIC DOCTYPE Declaration like this:

Code: Select all

<!DOCTYPE topic PUBLIC "urn:pubid:org.kuali.kits.kms:doctypes:dita:topic"
"https://svn.kuali.org/repos/kits/kms-dita-prototypes/org.kuali.kits.kms/doctypes/topic/dtd/kbtopic.dtd">
However, I want to be able to validate my files when there is no internet access so I want to point to the local versions of these DTDs. I thought that the way I do that is to create a catalog file that recognizes the PUBLIC identifier and associates it with a local uri. I create a catalog and entered it in Oxygen's XML Catalog page. It looks like this:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="urn:pubid:org.kuali.kits.kms:doctypes:dita:topic" uri="../org.kuali.kits.kms/doctypes/topic/dtd/kbtopic.dtd"/>
</catalog>
I turn off my wifi and try to validate the document and I get Schematron errors as it cannot reach the supplied url:
SystemID: /Users/jorahood/work/git/dita-prototypes/dmm3/test.dita
Main validation file: /Users/jorahood/work/git/dita-prototypes/dmm3/test.dita
Scenario name: DITA
Engine name: ISO Schematron (XSLT 2.0)
Severity: fatal
Description: svn.kuali.org (https://svn.kuali.org/repos/kits/kms-di ... btopic.dtd)

SystemID: /Users/jorahood/work/git/dita-prototypes/dmm3/test.dita
Main validation file: /Users/jorahood/work/git/dita-prototypes/dmm3/test.dita
Scenario name: DITA
Engine name: ISO Schematron (XSLT 2.0)
Severity: error
Description: I/O error reported by XML parser processing file:/Users/jorahood/work/git/dita-prototypes/dmm3/test.dita: svn.kuali.org (https://svn.kuali.org/repos/kits/kms-di ... btopic.dtd)
I don't understand how to accomplish my goal, can someone please help.

Thanks,
Andy

Re: Can I have a public DTD with a catalog entry fallback

Posted: Tue Nov 01, 2011 10:11 pm
by jorahood
For clarification, this is the way I added my own catalog: I entered it in the catalogs dialog box as
${pd}/catalogs/dita-kb.xml

I used the editor variable because I will be sharing the project with other users who will have it installed in different places.

Re: Can I have a public DTD with a catalog entry fallback

Posted: Wed Nov 02, 2011 12:34 pm
by Radu
Hi Andy,

The correct reference to the catalog.xml should be like this:

${pdu}/catalogs/dita-kb.xml

because the catalog entry should be in URL form.
On my Windows machine both forms work but I'm not so sure about Linux.

I tested the same scenario with a catalog having the content like this:

Code: Select all

<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="urn:pubid:org.kuali.kits.kms:doctypes:dita:topic" uri="file:/D:/projects/eXml/frameworks/dita/DITA-OT/dtd/technicalContent/dtd/topic.dtd"/>
</catalog>
which pointed the public ID to the default topic.dtd located in my DITA OT installation and it seemed to work without network access.

If it still does not work for you I could try to perform additional tests. Are there any additional errors than the errors you posted? Is the first error from the Xerces processor?

Also, if you want to publish the specialized topics using the DITA-OT bundled with Oxygen you should better add an additional entry in the:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/catalog-dita.xml

If you add this additional entry, it should be used both by Oxygen for validation + by the DITA OT for publishing but of course it would not be portable in a Project setting.

Regards,
Radu

Re: Can I have a public DTD with a catalog entry fallback

Posted: Wed Nov 02, 2011 6:07 pm
by jorahood
This worked for me, thanks!