Page 1 of 1

DTD search path - how can I specify?

Posted: Mon Feb 19, 2007 2:55 am
by rwellscs
I am editing XML in a source tree for which the DTD file in

<!DOCTYPE extension SYSTEM "safeextensions.dtd">

Is not actually in the current directory at source edit time, but will be after installation at execution time. There is not an obvious URI that I can give that would work for all developers, and for both development source editing and production execution.

But the DTD file is in a known place in one of my other Eclipse components.

How can I configure it to look for unfound DTD files in a series of other Eclipse component package paths?

Thanks,
Robert

Posted: Mon Feb 19, 2007 11:15 am
by sorin_ristache
Hello,

Starting with oXygen 8.1 you can resolve the DTD reference with an XML catalog based on the suffix of the DTD file. Create an XML catalog file like

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<systemSuffix systemIdSuffix="safeextensions.dtd" uri="file:///C:/your/path/to/the/folder/containing/your.dtd"/>
</catalog>
add the XML catalog file to the list of XML catalogs in Options -> Preferences -> XML -> XML Catalog and validate again the XML file containing

Code: Select all

<!DOCTYPE extension SYSTEM "safeextensions.dtd">
Regards,
Sorin

It works!

Posted: Mon Feb 19, 2007 10:34 pm
by rwellscs
I was able to get that working for me.

I tried to create a rule that for suffix ".dtd" would look in the folder path containing several .dtd files, but it complained that the folder path was not a file path... so I just created a systemSuffix rule for each of the .dtd files in that directory, mapping the base filename to the absolute path for each, and that is working very well.

Thanks!
Robert