Re: [xml] xmlcatalog: inconsistent behaviour between the --add and --del option?



Am Samstag, den 25.11.2006, 16:16 -0500 schrieb Daniel Veillard:
On Sat, Nov 25, 2006 at 09:26:27PM +0100, Daniel Leidert wrote:
Hello,

If I want to add an entry to the catalog, I have to specify the catalog
file:

xmlcatalog --add 'TYPE' 'ORIG' 'REPLACE' $CATALOG

but removing an entry works without giving the catalog file

xmlcatalog --del 'VALUE'

Normally I would have expected, taht even the `--add' option does not
require a catalog file (Shouldn't it simply try to examine
XML_CATALOG_FILES)? Or is this behaviour dedicated to the fact, that
XML_CATALOG_FILES can be a list of catalogs (which isn't a problem, if
en entry shall be removed)? But in this case I would expect, that --del
accepts a catalog file too.

  Looking at xmlcatalog.c code and the 2 APIs used underneath
namely xmlCatalogAdd() and xmlCatalogRemove(), I don't see any difference
in code between both option w.r.t. what catalog are loaded and affected.
 If you don't specify a catalog the default one is used in both cases.
Sorry I don't really understand the problem. This should work the same 
in both cases, either with an explicit catalog or a default catalog. 
However in the add case, assuming the orig value was matched by an entry
in the system catalog, maybe you just can't change that system catalog,
but it's just suppositions.

Ok. Here with two examples (maybe I'm just too stupid):

The --add option definitely does not work without a specified
catalog-file on the command line:

$ xmlcatalog --verbose --add 'publicId' 'foo' 'bar'
add command failed
Catalogs cleanup

Even the following fails:

XML_CATALOG_FILES="/path/to/my/catalog.xml" xmlcatalog --verbose --noout
(--create) --add 'publicId' 'foo' 'bar'

fails with the same error. I would have expected, that in the first
case, I see the catalog on stdout (like --del works). In the second
case, the given file should be updated/created. So far my understaing of
the manpage. As I said, maybe I just made a mistake.

Used is libxml2 from Debian/Sid

Regards, Daniel




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