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

Oxygen general issues.
MZHL
Posts: 2
Joined: Wed Jan 25, 2023 1:20 pm

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

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MZHL
Posts: 2
Joined: Wed Jan 25, 2023 1:20 pm

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

Post by MZHL »

Thanks a lot. This makes sense and works for me.
Post Reply