[xml] Lists in XML_CATALOG_FILES



Hi everyone,

The environment variable XML_CATALOG_FILES can be used to redirect the
catalog lookup to the user's own set of catalogs. The variable can contain a
list of catalog files. So far, so good.

Now, the function xmlLoadCatalogs says that the files in the list can be
separated with either a ':' or a space. What about the following

  XML_CATALOG_FILES=file:///etc/catalog:http://catsrv/catalog

How does the software know which colon is separating the two paths? The
space would work good as a separator, but the colon...?

Nevertheless, the libxml catalog initialisation code (function
xmlInitializeCatalog) plugs the content of XML_CATALOG_FILES directly into
the catalog entry. If XML_CATALOG_FILES is set to a list of catalogs, no
catalog is loaded. If XML_CATALOG_FILES points to a single file, everything
works as expected.

This behaviour is identical on Linux and Windows. It can be reproduced by
using the xmlcatalog executable. Set the XML_CATALOG_FILES to a list of two
catalogs, using either separator, and the lookup will fail. Set
XML_CATALOG_FILES to either one of the two entries, and the lookup works.

It seems to me that xmlInitializeCatalog function needs some additional
code. It should expand XML_CATALOG_FILES and produce a list of xmlCatalog
objects, as necessary. By the same token, a colon should not be alowed as a
separator. Space is good, perhaps a semicolon would be good as well?

Am I right here, or am I overlooking something? If I am right, I would fix
the code.

Ciao
Igor




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