Page 1 of 1

Lost ability to use xml catalog for xml-stylesheet PI?

Posted: Thu Jan 26, 2023 3:00 pm
by MZHL
I am new to this forum since I validate version 25.0 against my former version 16.1 and find that the ability of using the xml catalog for xml-stylesheet PI seems to be lost. I used to have this PI
<?xml-stylesheet type="text/css" href="-//ZSW//oxygen.css"?>
and was able to resolve it by my xml catalog, e.g. by
<rewriteURI uriStartString="-//ZSW//oxygen.css" rewritePrefix="custom/html/css/de/oxygen.css" />

Now with version 25.0 this does not resolve anymore and I tried various other options without success.
I appreciate any help on this.
Thx

Re: Lost ability to use xml catalog for xml-stylesheet PI?

Posted: Fri Jan 27, 2023 10:38 am
by Radu
Hi,

A pattern like this "-//ZSW//oxygen.css" looks like what you would use in a DOCTYPE public ID. The "href" attribute needs to either be a relative file location or an absolute URL reference (including protocol).

Here are some suggestions to make this work:
1) Leave your XML as it is but make the match in the catalog.xml more relaxed like:

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <uriSuffix uriSuffix="oxygen.css" uri="custom/html/css/de/oxygen.css"/>
</catalog>
2) Make the reference in the XML to the CSS to be a valid absolute URL reference:

Code: Select all

<?xml-stylesheet type="text/css" href="http://custom/oxygen.css"?>
and match it in the XML catalog:

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <uri name="http://custom/oxygen.css" uri="custom/html/css/de/oxygen.css"/>
</catalog>
Regards,
Radu

Re: Lost ability to use xml catalog for xml-stylesheet PI?

Posted: Fri Jan 27, 2023 1:05 pm
by MZHL
Thanks a lot. This makes sense and works for me.