Page 1 of 1

DTD Validation with XInclude and catalogs

Posted: Wed Apr 20, 2005 9:47 am
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

Posted: Fri Apr 22, 2005 1:09 pm
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

Posted: Fri Apr 22, 2005 1:45 pm
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