OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Catalog and <uri/>: Is this the right thing?


not sure if this question was already asked. I've tried to search the 
mailinglist but wasn't lucky so far.

I've studied the catalog.xml file which comes with every DocBook version. 
Usually the catalog files[1] contains entries like this:

  <uri name="http://docbook.org/xml/5.1/rng/docbook.rnc";

However, when you try to resolve that with xmlcatalog, the following happens:

  $ xmlcatalog catalog.xml http://docbook.org/xml/5.1/rng/docbook.rnc
  No entry for SYSTEM http://docbook.org/xml/5.1/rng/docbook.rnc
  (version 2.9.7 on openSUSE Leap 15.1)

It's the "No entry" line which is disturbing. I could live with that if I 
could suppress it. However, my naive assumption was to sent the error message 
to /dev/null. You can't. It doesn't work. :-(

Certainly, this could be seen as a bug in xmlcatalog as the error message is 
misleading. Unfortunately, the problem propagates further as this catalog 
can't be used in scripts. It makes the whole process of error handling much 
harder. For example, consider the following line:

  X=$(xmlcatalog catalog.xml http://docbook.org/xml/5.1/rng/docbook.rnc)

The poor X variable is filled with the above error message and the correct 
result. As an additional issue, return code is still zero. :-/

So it can't be solved by xmlcatalog, at least not now. However, we could 
"solve" it by changing the catalog file. So my question is this: is the <uri/> 
tag here really the best option? Do we miss a <system/> tag? Something like 

  <system systemId="http://docbook.org/xml/5.1/rng/docbook.rnc";

Maybe I completely misunderstand the use case of <uri/>. So I've looked into 
the XML Catalog Specification[2]:

  The uri element associates an alternate URI reference with a URI reference.

Okay... an alternative URI... to what? It's not entirely clear to me the 
difference between <uri/> and <system/> and why it is handled differently in 
xmlcatalog. Probably I miss some context here.

Apart from the spec, when I add an additional <system/> (or replace the <uri/> 
with <system/>), xmlcatalog is happy.

Should we reconsider the entries in the catalog to avoid such problems? Or do 
I miss something?

Thoughts? Thanks! :)

---- References
[1] https://docbook.org/xml/5.1/catalog.xml
[2] https://www.oasis-open.org/committees/entity/spec-2001-08-06.html#s.uri

  Thomas Schraitle

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]