AW: [xml] Catalogs and relative paths



Anyway, here's the catalog:

<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog 
V1.0//EN" 
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

  <system systemId="http://localhost/virtual/test.xml";
      uri="http://localhost/rewrite/really-test.xml"/>
  <uri name="http://localhost/virtual/test.xml";
      uri="http://localhost/rewrite/really-test.xml"/>

  <system systemId="http://localhost/virtual/include.xml";
      uri="http://localhost/rewrite/indirected.xml"/>
  <uri name="http://localhost/virtual/include.xml";
      uri="http://localhost/rewrite/indirected.xml"/>
</catalog>

This is wrong. You should be using 'rewriteURI' for that, not 'uri' or
'system':

  <rewriteURI uriStartString="http://localhost/virtual/test.xml";
    rewritePrefix="http://localhost/rewrite/really-test.xml"/>

Further, when you change that, note that 'rewrite/really-test.xml' xincludes
'include.xsl', means a document which is in the same directory. The
'virtual/test.xml' has been redirected to it and the base of the new
location is in rewrite, not in virtual. This means:

  <rewriteURI uriStartString="http://localhost/rewrite/include.xml";
                                               ^^^^^^^
    rewritePrefix="http://localhost/rewrite/indirected.xml"/>

If you put these two redirects in the catalog, it will work.

Ciao,
Igor



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]