GNOME Bugzilla – Bug 96963
SGML_CATALOG_FILES support broken in 2.4.26
Last modified: 2009-08-15 18:40:50 UTC
with libxml2 2.4.25 it works fine, with 2.4.26 it's broken. SGML_CATALOG_FILES=/home/coolo/prod/KDE/share/apps/ksgmltools2/customization/catalog /usr/local/bin/xmllint --catalogs --valid --noout index.docbook echo $? > 0 now add a :/tmp/foobar behind the variable SGML_CATALOG_FILES=/home/coolo/prod/KDE/share/apps/ksgmltools2/customization/catalog:/tmp/foobar /usr/local/bin/xmllint --catalogs --valid --noout index.docbook ; echo $? index.docbook:6: error: failed to load external entity "dtd/kdex.dtd" ]> ^ The reason is shown by strace: stat64("/home/coolo/prod/KDE/share/apps/ksgmltools2/customization/catalog:/tmp/foobar", 0xbfffedbc) = -1 ENOENT (No such file or directory) This is the cause for KDE bug 49661: http://bugs.kde.org/show_bug.cgi?id=49661 Greetings, Stephan
Probably some of the changes introduced to catalog.c I will try to look into this. You should really be using the XML catalogs anyway, and : is a perfectly legal filesystem character. Daniel
Last time we discussed this, we agreed that the URI notation should be supported in these environment variables, because this is the only notation which is the same on all platforms. This results in 'file://...' notations being fully supported. Remote resources are supported as well, by design, even if their use is discouraged. This means that the colon ':' cannot be used to separate entries any longer. At this moment, only the space ' ' can be used for this purpose, as it is an obvious character which cannot be contained in an URI without escaping. Path specifications in the native filesystem notation are supported as well on all platforms, as long they use the space to separate entries. If you have a directory with a space in its name, you must use an URI notation for this directory. You can mix URI and filesystem notations at whim. Making this work with a colon as a separator again will break the use of URIs on Unix. It will break entirely on all platforms which have non-Unix filesystem notation which involves the colon frequently (Windows for sure, perhaps VMS and RiscOS as well?) Igor
Basically I agree with both of you, esp. with Daniel's short statement (use proper catalogs). OTOH, please leave SGML_CATALOG_FILES as it ever was (for compatibility, or soemthing). Invent a new variable that works as described by Igor (SGML_CATALOG_RESOURCES or something like that). Is this a way to go?
This is the documentation of xmlLoadCatalogs as found in the version 2.4.16 (which is the minimum version we currently require) /** * xmlLoadCatalogs: * @paths: a list of file path separated by ':' or spaces .... So kdoctools follows documented behaviour. So unless you want it to be libxml3 I'd say simply breaking the behaviour of the variable is no good and Karl's suggestion is the next best thing.
Peace, brothers :-) Back then, when we discussed this matter on the libxml mailing list, the talk was about the default catalogs. It was even discovered that the default catalog variable (XML_CATALOG_FILES) didn't work at all if you put a list of paths in it, no matter how you separate the entries. This was a clear sign that noone has been using the feature and nothing existing can be broken. I introduced an URI notation into this variable in order to make it work as expected on all platforms believing that nothing will be broken because it didn't work at all until then. This has however nothing to do with the xmlLoadCatalogs function. The function xmlLoadCatalogs was changed as well, which I did in oder to get a consistent behaviour between XML_CATALOG_FILES and SGML_CATALOG_FILES when used through xmllint utility. That was obviously a mistake :-) I would suggest: 1. I'll revert the behaviour of xmlLoadCatalogs function to allow entry separation with either the space or a colon, just the way it was before my machinations. 2. I can introduce another function, say xmlLoadCatalogList or whatever the name may be, which would then introduce the new behaviour. The content of XML_CATALOG_FILES will not be changed by that. XML_CATALOG_FILES will still be expected to separate entries with a space and use an URI notation where necessary. Is that okay? You would have the compatibility back, but would have to change the format of your path collection strings, should you decide to put it in the envvar XML_CATALOG_FILES in the future. Igor
Okay, I fixed this now. I gave xmlLoadCatalogs the old behaviour. Igor
Thanks a lot -- your recipe sounds good. I'm sure coolo will give it a try some time soon and report problems if any ;-)
This should be closed in the last releases, Daniel