[xml/sgml-pkgs] Bug#258697: docbook-utils.dsl overriding site-local config in /etc/sgml/docbook-dsssl/html/siteconfig.dsl

Sean Champ Sean Champ <schamp@users.sourceforge.net>, 258697@bugs.debian.org
Sat, 10 Jul 2004 20:46:33 -0700


Package: docbook-utils
Version: 0.6.13-7
Severity: normal


* Background:

 Using debconf, I'd defined the value #t for %use-id-as-filename%, in 
 /etc/sgml/docbook-dsssl/html/siteconfig.dsl
 
 But, when I ran 'docbook2html', i noticed that the 'id' attribute was /not/
 being used as the filename, for each individual 'section' element and so-on.
 
 but, when I ran docbook2html -V "%use-id-as-filename%" somefile.sgml
 then it worked as expected.
 
 
 
After some digging in the shell scripts, it looks like 
  /usr/share/docbook-utils/docbook-utils.dsl
is being used *before* either of  /etc/sgml/docbook-dsssl/html/siteconfig.dsl
or  /etc/sgml/docbook-dsssl/print/siteconfig.dsl

So, any values defined in docbook-utils.dsl, the will override anything defined
in the particular siteconfig.dsl


* siteconfig.dsl overridden by docbook-utils.dsl


The two siteconfig.dsl files are referenced from within the respective
  /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
 or
   /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl
stylesheets.

Those stylesheets are referenced *after*
 /usr/share/docbook-utils/docbook-utils.dsl
 


docbook-utils.dsl references the respective nwalsh stylesheet, but not
until after it's already added its own stuff; the nwalsh stylesheet, then,
is what references the correct siteconfig.dsl 



docbook-utils.dsl is being used, as the top-level styelsheet, becasue:
 - by default, JW calls   /usr/share/docbook-utils/frontends/docbook
   in order for JW to see which SGML_STYLESHEET to use
   
 - that 'docbook' frontend script is configured to emit the file-name of
    docbook-utils.dsl, by defualt. 



 docbook-utils.dsl defines %use-id-as-filename% to #f; since that is the
first time that the value is defined, then that will be the value that will
be used throughout the stylesheets.

So, by the time that the correct nwalsh stylesheet has been called, and then
it calls the respective siteconf.dsl (i'm guessing that it makes the call,
somehow, before it sets many values, itself), then that siteconf.dsl will
only be useful for setting values that were not set in docbook-utils.dsl





* Suggestion 1 : empty-out docbook-utils.dsl

The "easiest", most hasty resolution, which I can figure, enough to suggest,
would be to remove the explicit dsssl expressions from 
   /usr/share/docbook-utils/docbook-utils.dsl
but leave the file there, so :

- allowing the respective siteconf.dsl files to be used for setting *all* of
   the values that the stylesheet-user would like to  modify -- and without
   the user having to resort to using multiple instances of the -V argument
   on every call to jw or dobook2foo
    
 - leave the file in place, in case anyone has an existing stylesheet setup
   that requirs the presence of docbook-utils.dsl
   
Now, a problem with that, might be that the expressions in docbook-utils.dsl
are eliciting behaviors, from docbook2html and docbook2ps, which users will
have grown accustomed to -- and which are very useful, if they would
just not override the user's own settings.

* Suggestion 2 : use docbook-utils.dsl as a template for a new, top-level driver

Perhaps, then, something could be conceived for ensuring that the
right siteconfig.dsl file will be referenced *before*
docbook-utils.dsl

Perhaps the file docbook-utils.dsl could be used as a template.

Let's say that we'd copy docbook-utils.dsl to
/etc/sgml/docbook-dsssl/custom.dsl , then remove all of the dsssl 
expressions from it, and have it reference the respective siteconfig.dsl
file (for #html or #print)  *then* reference docbook-utils.dsl -- *after* the 
right siteconfig file.

Then   /usr/share/docbook-utils/frontends/docbook could be modified, so as
to use /etc/sgml/docbook-dsssl/custom.dsl (in this example) as the 'default'
stylesheet 


I'd offer a patch for trying this, but I'm afraid that i do not, yet, have
quite a handle on the DSSSL and DSSSL-stylesheet SGML syntax.


Hoping, still, this might help for something,

--
sean




-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i586)
Kernel: Linux 2.6.7
Locale: LANG=en_US, LC_CTYPE=en_US.iso88591

Versions of packages docbook-utils depends on:
ii  docbook-dsssl             1.78-4         modular DocBook DSSSL stylesheets,
ii  jadetex                   3.13-1         generator of printable output from
ii  links-ssl [links]         0.98-2         Character mode WWW browser with SS
ii  lynx                      2.8.5-1        Text-mode WWW Browser
ii  perl                      5.8.4-2        Larry Wall's Practical Extraction 
ii  sgmlspl                   1.03ii-30      SGMLS-based example Perl script fo
ii  sp                        1.3.4-1.2.1-42 James Clark's SGML parsing tools

-- no debconf information