DTD search path - how can I specify?

This should cover W3C XML Schema, Relax NG and DTD related problems.
rwellscs
Posts: 2
Joined: Mon Feb 19, 2007 2:48 am

DTD search path - how can I specify?

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
rwellscs
Posts: 2
Joined: Mon Feb 19, 2007 2:48 am

It works!

Post 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
Post Reply