Pages: 1
Print
Author Topic: Unusual problem with XMetal and specialized DITA DTD  (Read 6152 times)
barbwire
Member

Posts: 44


« on: March 06, 2012, 05:25:24 AM »

Hello,

I have an unusual (?) problem with XMetal 6.0 and specialized DITA DTD, which I require answer. I have already figured out, how to fix this issue, but it is so unusual that I need an answer why XMetal behaves like this.

Issue:

I have for example following DITA specialization:

123456.xml
mydtd.dtd

When these files are in folder (for example) C:\temp\, XMetal opens xml correctly and tells that xml is validated against dtd. Everything is fine and everybody is happy.

But when the exactly same files are in folder C:\Users\barbwire\something\weird\ (for example), XMetal opens xml and says, that xml is not valid. It obviously does not recognize the dtd (or can not find it), but why it does like this? If I modify security settings for the users, issue goes away, but I still don't understand, that why XMetal says that XML document is not valid? If I use XMetal to specialize the DTD, it does not work either. The only way seems to be with the users rights.
Logged
pmasal
Member

Posts: 86


« Reply #1 on: March 06, 2012, 06:39:40 AM »

It is probably because C:\Program Files\XMetaL version\Author\DITA\DITA_OT_DTD\catalog-dita.xml does not have an entry for your specialized DTD.

When you open a specialized DITA topic that specifies a dtd like "mydtd.dtd", XMetaL will first look in the current folder for the DTD. If it doesn't find the DTD there, it will consult the catalog file to determine the DTD location, using a "public identifier" to determine the topic type (you'll see the public IDs when you open the file).

If you update the catalog file with the DTD information, you should be fine.
Paul Masalsky
EMC
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: March 06, 2012, 02:07:00 PM »

The only way XMetaL would tell you that your file is invalid in one instance but valid in another is that it is using two different DTDs depending on the location of the XML file, the SYSTEM and PUBLIC id and any catalog entries available that match the PUBLIC id. Check the SYSTEM path in the XML document to see that it is in fact pointing to the DTD in the same folder, and that the DTD itself does not reference any other files.

Note that XMetaL has an extensive catalog lookup mechanism in place for DITA documents and so if your XML file points to a DTD that cannot be found using the SYSTEM id XMetaL will use the PUBLIC id if present. If it finds a matching PUBLIC id in its catalogs then it will use one of the standard DITA DTDs that are installed with the product. I suspect that is what is occurring in your case.

You will want to deploy your specialized DITA DTD so that XMetaL provides you with a DITA authoring experience. You cannot deploy it to a random location as you can with any other DTD if you want XMetaL to recognize it as DITA. If you deploy your DTD using any other method than the one described in the following help topic then it will not be recognized as DITA. What that means is that XMetaL will auto-generate a basic customization for you (CSS and CTM file) giving you basic XML authoring experience, but none of the special DITA authoring functionality will be enabled.

see help topic: Working with DITA > Specializations (and all subtopics)

Logged
barbwire
Member

Posts: 44


« Reply #3 on: March 07, 2012, 12:56:21 AM »

It is probably because C:\Program Files\XMetaL version\Author\DITA\DITA_OT_DTD\catalog-dita.xml does not have an entry for your specialized DTD.

When you open a specialized DITA topic that specifies a dtd like "mydtd.dtd", XMetaL will first look in the current folder for the DTD. If it doesn't find the DTD there, it will consult the catalog file to determine the DTD location, using a "public identifier" to determine the topic type (you'll see the public IDs when you open the file).

If you update the catalog file with the DTD information, you should be fine.
Paul Masalsky
EMC
There is no file catalog-dita.xml. Do you mean file called dita_xac_catalog_specialized.xml which is located at \XMetaL6.0\Author\DITA\XACs. Because I have added the specialization by using Tools > Select specialized DITA DTD and everything goes fine. There is a correct mark at dita_xac_catalog_specialized.xml file and XACs-folder containc correct folder. XMetal still works illogically as described after this. Believe me, I have read manual and watched all examples by JustSystems, but I still can not understand this issue, which seems to be somehow related to folder user rights or there is something very wrong here with my own logical thinking. :)
Logged
barbwire
Member

Posts: 44


« Reply #4 on: March 07, 2012, 06:02:58 AM »

The only way XMetaL would tell you that your file is invalid in one instance but valid in another is that it is using two different DTDs depending on the location of the XML file, the SYSTEM and PUBLIC id and any catalog entries available that match the PUBLIC id. Check the SYSTEM path in the XML document to see that it is in fact pointing to the DTD in the same folder, and that the DTD itself does not reference any other files.
SYSTEM path refers to the same folder where xml file is. Therefore this can't be a SYSTEM related problem. I am also sure that DTD is not referencing to any other files so that can not be a problem in this case.

Note that XMetaL has an extensive catalog lookup mechanism in place for DITA documents and so if your XML file points to a DTD that cannot be found using the SYSTEM id XMetaL will use the PUBLIC id if present. If it finds a matching PUBLIC id in its catalogs then it will use one of the standard DITA DTDs that are installed with the product. I suspect that is what is occurring in your case.
There is no matching PUBLIC id in the catalog. I have actually tried to add specialized DTD through Tools > Select specialized DITA DTD, but it does not work either. My PUBLIC id is totally different than basic DITA PUBLIC ids so that can not be a problem. Therefore I do not believe that PUBLIC id mathing is the problem.

You will want to deploy your specialized DITA DTD so that XMetaL provides you with a DITA authoring experience. You cannot deploy it to a random location as you can with any other DTD if you want XMetaL to recognize it as DITA. If you deploy your DTD using any other method than the one described in the following help topic then it will not be recognized as DITA. What that means is that XMetaL will auto-generate a basic customization for you (CSS and CTM file) giving you basic XML authoring experience, but none of the special DITA authoring functionality will be enabled.

see help topic: Working with DITA > Specializations (and all subtopics)


I have read whole help and it really does not help. :) The solution for this problem is (like I said) user rights, but in a way I do not understand that, because if I can edit my XML-file, why can't XMetal read DTD from the same folder, when my XML's SYSTEM id refers to the same folder?

OK, now I found the real reason...

It is the mydtd.rlx. It was an old one and for some reason XMetal does not update it. When I deleted the old one, mydtd.rlx, XMetal created new .rlx file and DTD was actually validated correctly!
Logged
Pages: 1
Print
Jump to:  

email us