On Tue, 2019-03-12 at 13:46 +0100, Christian Grün wrote:
> Hi Liam,
> 
> Thanks for the enclosed example. I am still trying to figure out how
> to run it, so I tried to simplify everything.
> 
> As you can easily guess, my knowledge on XML catalogs is rather
> limited: For example, when trying to run the example with fetch:xml,
> I
> noticed that the URI resolution works if I change "nonsense.dtd" to
> "http://nonsense.dtd"; (both in all.xml and in saxalog.xml). I wonder
> why it works without the URI scheme on your system? I have attached
> my
> simple example for fetch.xq.

Note that i have a public identifier, so using prefer-public lets that
be resolved.

Adding a CatalogManagers.properties file that says verbose=9999 helps
to debug this stuff.

I used the Apache resolver class because it's commonly used also with
Saxon.

> Maybe we manage to construct a fully-stripped down, minimized
> instance
> of the example that works with XSLT 1.0?

Enclosed.

> The more I think about URI resolution, the more I see why it could
> make sense to handle catalog resolution globally.

Especially since the “CATFILE” option is really a semicolon-separated
list of files.

>  In the given case,
> I’ll still need to understand why it makes a difference if we assign
> the value of the CATFILE option or the xslt:transform option to the
> transformer?

Seems the latter is ignored, except that if it's not given, the URI
resolver is not enabled. But i tihnk the catalog should be enabled
everywhere if it's set.

It's hard to come up with a use case for having catalog being used for
doc() and for files loaded into the database and not for files opened
in subsidiary modules, and using different catalog files in different
parts of the same query sounds like a nightmare for users to debug.

Note, by the way, that instantiating a resolver is relatively expensive
- the code looks for a whole bunch of files - and also that resolving a
file will look by default for CatalogManager.properties in a bunch of
places, so that this would slow down (for example) importing 10,000 XML
files; a static resolver is probably much faster, which is why i'd left
the two options - ignore missing, and static. I don't want to be
responsible for slowing down BaseX! :-) :-)

Liam


-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/

<<attachment: catalogtestxslt1.zip>>

Reply via email to