Use local system dtd?

Oxygen general issues.
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Use local system dtd?

Post by anderszvensson »

Hi,

I have some dita files that have doctype declarations specifying both public id and system id, but for this particular case I need the transformation to use the system id. Is it possible to make the transformation prioritize the system id instead of the public id?

Regards,

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

Re: Use local system dtd?

Post by Radu »

Hi Anders,

Oxygen has such a setting in the Preferences->XML / XML Catalog page (Prefer->System). This setting is used to validate and offer content completion for XML files opened in Oxygen.
But, as you know, when publishing DITA content Oxygen just launches an ANT process using the DITA Open Toolkit.
Unfortunately I looked over the Java code in the DITA Open Toolkit and it prefers the PUBLIC ID (hard-coded, with no parameter which can be set).

Maybe I can build a patch for the DITA OT for you to bypass this problem.

What is your case more exactly? Should the system IDs get resolved through catalogs or are they just references (relative or absolute?) to the local file system?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Re: Use local system dtd?

Post by anderszvensson »

Well, actually the problem is something that I know has come up before, and I thought it would be resolved simply by choosing the local DTD. The thing is, the dita files have nbsp entities in them, and the local DTD has a declaration for this entity. But it doesn't seem to help.

I searched the archives and found that there was an answer saying you should set the disable.grammar.caching parameter. I'm guessing this is a parameter you have to create in the transformation scenario as a new parameter? Because I didn't see one there. But I tried doing this (tried both the value "false" and "true", but neither did any difference. I still get the error message: "The entity "nbsp" was referenced, but not declared."

Again, in the DTD I have this entity declared, but it doesn't work anyway. (I switched the DTD:s in the directory referenced by catalog-dita.xml to the local ones so that the system/public id wouldn't matter).

So why does this occur and what can I do?

Regards,

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

Re: Use local system dtd?

Post by Radu »

Hi Anders,

So my original report of the problem to the DITA OT bugs list was this:
http://sourceforge.net/tracker/index.ph ... tid=725074
Here is another discussion:
http://tech.groups.yahoo.com/group/dita ... sage/20167

The idea is that:
Are you using a custom DITA OT installation or the one in Oxygen?

If you are using the DITA OT in Oxygen:
1) If you are using Oxygen 11.x there is no such a parameter to avoid the issue. Maybe I can try to make a patch to the DITA OT for this if this is the case, so contact me on the support email address if this is the case.
2) If you are using Oxygen 12, Oxygen 12 has a patch in the DITA OT which controls this behavior using the parameter disable.grammar.caching setting it to yes

Oxygen 12.1 will come with DITA OT 1.5.2M5 which added its own parameter for this called args.grammar.cache which you can set to no.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Re: Use local system dtd?

Post by anderszvensson »

Ok, great. That seems to have fixed it. I'm using v.12, but I thought the value should be "false". So just to get this straight, this is a DITA OT bug?

Regards,

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

Re: Use local system dtd?

Post by Radu »

Hi Anders,

They say it's a "feature", more exactly that the DITA specification deprecates the use of entities so users shouldn't use them at all.
&nbsp; as an entity was declared in a previous version of the DITA DTDs and was kept for backward compatibility.
Basically you can also replace all your &nbsp;'s with the equivalent hexa code &#xa0; which will work even if grammar caching is enabled (and in all future versions of the DITA OT).

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