DTD Validation with XInclude and catalogs

This should cover W3C XML Schema, Relax NG and DTD related problems.
relausen
Posts: 4
Joined: Wed Apr 20, 2005 9:22 am

DTD Validation with XInclude and catalogs

Post by relausen »

Hi!

I have a problem with validating a document within oXygen 5.1.

I have a main document similar to this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book
PUBLIC "-//MIKROV//DTD DocBook XML V4.3-based Extension Mikrov V1.0//EN"
"http://someserver.ddd/docbook/schema/mikrov/dtd/mikrov.dtd">
<book>
<title>Help</title>
<xi:include href="file:///mikrovroot/development/components/reader/documents/help/help.dbx"/>
</book>
The directory mikrovroot in the xinclude's href is a fictive directory, which is mapped to a real directory by a catalog entry.

Validating this gives an error because the parser uses the href as is, without using the catalog entry. Transforming it to, e.g., PDF works fine - just to point out that XIncludes and the catalog works fine in other contexts. Validating on the command line with xmllint also works fine. Validating with XIncludes disabled in settings also works fine (I have added the xi:include element in my customization of DocBook).

How can I tell the parser to use catalogs when resolving the href in XIncludes?

Best regards,

Rune Lausen
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hi,

I tried with the same fictive path and it worked. You use rewriteURI in your catalog ? For validation you need rewriteSystem or system. If it doesn't work please post your catalog file.

Best Regards,
Sorin
relausen
Posts: 4
Joined: Wed Apr 20, 2005 9:22 am

Post by relausen »

sorin wrote:Hi,

I tried with the same fictive path and it worked. You use rewriteURI in your catalog ? For validation you need rewriteSystem or system. If it doesn't work please post your catalog file.

Best Regards,
Sorin
It worked! Thank you very very much!

I did use rewriteURI, as per Bob Staytons excellent book on DocBook XSL stylesheets. I did'nt realize that the interpretation (system vs. URI) was different when validating. In retrospect it seems logical, since DTDs only references PUBLIC og SYSTEM identifiers, whereas stylesheets always uses URIs.

With both a rewriteURI and a rewriteSystem everything works like a charm.

Thanks again!

Best regards

Rune
Post Reply