Hi Liam,

Thanks for the reply and suggestions. Based on your suggestion I tried pragmas 
and strace, and had another go at CatalogManager.properties, but they've not 
had any effect. (I'm using Windows 10 but was able to run strace in Ubuntu via 
WSL). This query:

try {
  (# db:catfile 'schemas/catalog.xml' #)
  (# db:intparse false #)
  (# db:dtd true #)
  (# db:chop false #)
  { xslt:transform('file.xml', 'stylesheet.xsl')//inlinegraphic }
} catch * { $err:description }

Produces the same error again due to the DTD not being available at the system 
literal URI.

I did try setting verbosity 99 in a CatalogManager.properties file on the 
classpath, but this did not produce any additional messages. I also tried 
setting the same properties directly when launching BaseX this did not work 
either. Specifically, I set the following system properties when launching 
BaseX, and then used proc:property() in a query to confirm that these system 
properties were in fact set.

'xml.catalog.verbosity': '99'
'xml.catalog.ignoreMissing': 'no'
'xml.catalog.catalog-class-name': 'org.apache.xml.resolver.Resolver'
'xml.catalog.files': 'schemas/catalog.xml'

xml-resolver-1.2.jar and Saxon are definitely on the classpath.


Vincent M. Lizzi
Head of Information Standards | Taylor & Francis Group

Information Classification: General
From: Liam R. E. Quin <l...@fromoldbooks.org>
Sent: Wednesday, July 8, 2020 10:28 PM
To: Lizzi, Vincent <vincent.li...@taylorandfrancis.com>; BaseX 
Subject: Re: [basex-talk] xslt:transform function not working with XML Catalog

On Wed, 2020-07-08 at 22:46 +0000, Lizzi, Vincent wrote:
> I've encountered a problem using xslt:transform in to transform some
> old XML that contains a DTD DOCTYPE system literal pointing to a non-
> working URI and also uses ENTITYREF attributes to refer to image
> files. I have the XML Catalog configured correctly using CATFILE.

If this is on Linux, using strace can help check which catalog file is
being used; you can also turn on debugging in a
CatalogManager.properties file containing the line
verbosity = 999
(thee file needs to be in your Java classpath).

There's also a BaseX pragma, (# db:catfile path/to/catalog.xml #) {

You need to turn off the BaseX internal parser.

Make sure that the resolver library and of course saxon are in your
class path.

You may need to add,
declare option db:catfile "path/relative/to/cwd/catalog.xml";
to your query.


Liam Quin, 
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: 

Reply via email to