docbook-apps

Expand all | Collapse all

DocBook xslTNG prerelease 2.0.2

  • 1.  DocBook xslTNG prerelease 2.0.2

    Posted 01-06-2023 18:53
    Hi folks,

    I’ve been trying to get a new version of the DocBook xslTNG Stylesheets
    finished for a few weeks now. The big (and sometimes backwards
    incompatible changes) are:

    * The system for dealing with generated text has been completely
    rewritten. We’re back to using templates as described in Chapter 4 of
    the updated reference guide. Most of the parameters, variables, and
    functions associated with gentext have been removed. Properties have
    been removed and all template lookups are now done with XPath
    expressions instead ad hoc string matching.

    * It’s likely that there are small changes to the way lists-of-titles
    and cross references are formatted by default in some cases.

    * Labels for formal objects may be different, but I think these changes
    actually fix previously unreported bugs.

    * In some contexts, for example callouts, labels are now used for the
    links instead of titles.

    * The parameters for the t:top-nav and t:bottom-nav templates have
    changed. These templates are now always called, even when chunking is
    not being performed. The new $chunk parameter indicates whether or not
    a chunk is being formatted.

    * Fixed a bug where orderedlist numeration was not handled correctly in
    cross-references to list items.

    * Made another attempt at sorting out how media object URIs are resolved
    in the source (for reading their properties) and formatted in the
    output. If the $mediaobject-input-base-uri is specified, it is always
    used. Documented some subtleties with respect to the
    $chunk-output-base-uri parameter.

    * Added support for ISO 690 bibligraphes.

    * Fixed bug where authorgroup wasn’t being processed in biblioentry.

    * I reworked the way the persistent ToC is generated. You can now have a
    single, external ToC instead of nesting it in every chunk. The way
    navigation works and the CSS have been improved.

    * I removed up arrow from $chunk-nav (issue #170). That will be in 2.0.3
    which hasn’t been pushed to Maven yet.

    There are probably other changes as well, fixing localization was a
    pretty substantial change.

    Many customization layers will need to be updated before they’ll
    generate the right output. If you’re having trouble, please open up a
    bug report and I’ll try to help.

    I have pushed 2.0.2 to Maven for everyone’s convenience.

    I’ve reworked The Definitive Guide and a couple of other projects to use
    the 2.x stylesheets and it seems to be going well. I’d love feedback
    from folks who use the localization support.

    I expect if there are no new reports, I’ll wrap it up as 2.1.0 in a week
    or so and make it the current official version.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > Everything is temporary.



  • 2.  DocBook xslTNG prerelease 2.0.7

    Posted 02-03-2023 14:43
    Hi folks,

    A few weeks ago, I posted a note about the DocBook xslTNG Stylesheets
    then current 2.0.2 prerelease. This morning I posted 2.0.7. The big
    change is in handling of media:

    https://xsltng.docbook.org/guide/2.0.7/ch-customizing.html#media

    Feedback eagerly solicited.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > You must not think me necessarily foolish because I am facetious, nor
    > will I consider you necessarily wise because you are grave.--Sydney
    > Smith



  • 3.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-06-2023 15:23
    Hi

    On 03.02.23 15:43, Norm Tovey-Walsh wrote:
    >
    > A few weeks ago, I posted a note about the DocBook xslTNG Stylesheets
    > then current 2.0.2 prerelease. This morning I posted 2.0.7. The big
    > change is in handling of media:
    >
    > https://xsltng.docbook.org/guide/2.0.7/ch-customizing.html#media
    >
    > Feedback eagerly solicited.

    Thanks for all your efforts and time! \o/ Much appreciated!

    This time I've tried it with the sources from https://github.com/SUSE/doc-sle.
    Before I called it, I had to prepare a directory of all image files under
    build/.tmp/img. That directory contains all the links to images/src/ (we have
    separate directories for PNG and SVG).

    The main file is xml/MAIN.SLEDS.xml and contains all XIncludes for different
    chapters. I run the docbook script with the following arguments:

    ---------------------
    $ /tmp/docbook-xslTNG-2.0.7/bin/docbook -xi \
    -s:xml/MAIN.SLEDS.xml -o:build/.tmp/SLES-installation.html \
    -xsl:/usr/share/xml/docbook/stylesheet/xsltng/xslt/docbook.xsl \
    media-input-base-uri=build/.tmp/img \
    mediaobject-output-base-uri=media/
    No localization exists for "" or "". Using default "en".
    Error at xsl:text on line 169 column 19 of functions.xsl:
    XTMM9000 Processing terminated by xsl:message at line 169 in functions.xsl
    at function f:l10n-language on line 139 column 65 of functions.xsl:
    invoked by function call at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/modules/gentext.xsl#95
    at function fp:localization-template on line 91 column 60 of gentext.xsl:
    invoked by unknown caller (class net.sf.saxon.value.MemoClosure)
    at function fp:localization-template on line 91 column 60 of gentext.xsl:
    invoked by function call at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/modules/gentext.xsl#433
    In template rule with match="*" on line 428 of gentext.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#372
    In template rule with match="*" on line 370 of 50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#351
    at template tp:normalize-generated-title on line 320 column 51 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#256
    In template rule with
    match="element(Q{http://docbook.org/ns/docbook}abstract)" on line 255 of
    50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#435
    at template tp:normalize-dbinfo on line 424 column 42 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#383
    In template rule with match="element(Q{http://docbook.org/ns/docbook}info)"
    on line 377 of 50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#102
    at template tp:normalize-movetitle on line 96 column 45 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#491
    In template rule with match="*" on line 477 of 50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#111
    at template tp:normalize-movetitle on line 96 column 45 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#491
    In template rule with match="*" on line 477 of 50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#102
    at template tp:normalize-movetitle on line 96 column 45 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#491
    In template rule with match="*" on line 477 of 50-normalize.xsl
    invoked by xsl:apply-templates at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#102
    at template tp:normalize-movetitle on line 96 column 45 of 50-normalize.xsl:
    invoked by xsl:call-template at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#491
    In template rule with match="*" on line 477 of 50-normalize.xsl
    invoked by xsl:next-match at
    file:/usr/share/xml/docbook/stylesheet/xsltng/xslt/transforms/50-normalize.xsl#27
    In template rule with match="/*" on line 25 of 50-normalize.xsl
    invoked by built-in template rule (text-only)
    Processing terminated by xsl:message at line 169 in functions.xsl
    ---------------------

    I don't know where this 'No localization exists for ""' comes from. Had it in
    previous versions, too. ;) Of course, the result HTML is zero bytes. :)

    To help debugging, would it make sense to have an option that the HTML could be
    still generated? Even if there are some errors?

    Although the HTML might be broken, it could give some hints where the XML
    source contains some strange structures.

    Thanks!

    --
    Gruß/Regards
    Thomas Schraitle




  • 4.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-06-2023 18:48
    On 06/02/2023 15:23, Thomas Schraitle wrote:
    ...
    > No localization exists for "" or "". Using default "en".
    > Error at xsl:text on line 169 column 19 of functions.xsl:
    >   XTMM9000  Processing terminated by xsl:message at line 169 in
    > functions.xsl

    Do you have any 'xml:lang=""' in your document(s)?

    It looks like the function [1] can really only generate 'No localization
    exists for "" or "".' if '$gentext-language' is not set (not that I know
    how to set it) and there's an 'xml:lang=""' somewhere in your document.

    The 'terminate="yes"' on line 168 does rather contradict the message
    that processing will continue with the default language.

    Regards,


    Tony Graham.
    --
    Senior Architect
    XML Division
    Antenna House, Inc.
    ----
    Skerries, Ireland
    tgraham@antenna.co.jp


    [1]
    https://github.com/docbook/xslTNG/blob/main/src/main/xslt/modules/functions.xsl#L139



  • 5.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-06-2023 18:58
    On Mon, 6 Feb 2023 at 18:48, Tony Graham <tgraham@antenna.co.jp> wrote:
    >
    > On 06/02/2023 15:23, Thomas Schraitle wrote:
    > ...
    > > No localization exists for "" or "". Using default "en".
    > > Error at xsl:text on line 169 column 19 of functions.xsl:
    > > XTMM9000 Processing terminated by xsl:message at line 169 in
    > > functions.xsl
    >
    > Do you have any 'xml:lang=""' in your document(s)?
    >
    > It looks like the function [1] can really only generate 'No localization
    > exists for "" or "".' if '$gentext-language' is not set (not that I know
    > how to set it) and there's an 'xml:lang=""' somewhere in your document.
    >
    > The 'terminate="yes"' on line 168 does rather contradict the message
    > that processing will continue with the default language.

    Which begs the question, where to set the default language, and should
    it be reported as a bug if not set?
    [Guess, $gentext-language will default to 'default language' - does
    that make sense?]

    HTH
    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    Docbook FAQ.



  • 6.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-06-2023 19:07
    On 06/02/2023 18:58, Dave Pawson wrote:
    > On Mon, 6 Feb 2023 at 18:48, Tony Graham <tgraham@antenna.co.jp> wrote:
    >>
    >> On 06/02/2023 15:23, Thomas Schraitle wrote:
    >> ...
    >>> No localization exists for "" or "". Using default "en".
    >>> Error at xsl:text on line 169 column 19 of functions.xsl:
    >>> XTMM9000 Processing terminated by xsl:message at line 169 in
    >>> functions.xsl
    >>
    >> Do you have any 'xml:lang=""' in your document(s)?
    >>
    >> It looks like the function [1] can really only generate 'No localization
    >> exists for "" or "".' if '$gentext-language' is not set (not that I know
    >> how to set it) and there's an 'xml:lang=""' somewhere in your document.
    ...
    > Which begs the question, where to set the default language, and should
    > it be reported as a bug if not set?
    > [Guess, $gentext-language will default to 'default language' - does
    > that make sense?]

    If you look at line 145, $default-language is used if there's no
    $gentext-language and no @xml:lang. An empty @xml:lang would be used
    ahead of $default-language and would result in those empty values in the
    error message.

    Regards,


    Tony Graham.
    --
    Senior Architect
    XML Division
    Antenna House, Inc.
    ----
    Skerries, Ireland
    tgraham@antenna.co.jp


    [1]
    https://github.com/docbook/xslTNG/blob/main/src/main/xslt/modules/functions.xsl#L139



  • 7.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-06-2023 21:13
    On 06.02.2023 20:07, Tony Graham wrote:
    > If you look at line 145, $default-language is used if there's no
    > $gentext-language and no @xml:lang.  An empty @xml:lang would be used
    > ahead of $default-language and would result in those empty values in the
    > error message.

    Empty @xml:lang can be result of XInclude when included files do not
    explicitly specify @xml:lang.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML and Web consulting and training services
    DocBook/DITA customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------



  • 8.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-07-2023 08:54
    Jirka Kosek <jirka@kosek.cz> writes:
    > Empty @xml:lang can be result of XInclude when included files do not
    > explicitly specify @xml:lang.

    *Blink*. Really? I would not have expected language fixup to do that,
    but maybe it does. So xml:lang="" is equivalent to $default-language,
    I suppose.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > A proof tells us where to concentrate our doubts.--Anonymous



  • 9.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-07-2023 14:00
    On 07.02.2023 9:53, Norm Tovey-Walsh wrote:
    > *Blink*. Really? I would not have expected language fixup to do that,
    > but maybe it does. So xml:lang="" is equivalent to $default-language,
    > I suppose.

    Well, I don't know if this is what XInclude spec says but IIRC there
    were some XInclude processors that did that.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML and Web consulting and training services
    DocBook/DITA customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------



  • 10.  RE: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-08-2023 00:28
    Jirka Kosek <jirka@kosek.cz> wrote:

    > On 07.02.2023 9:53, Norm Tovey-Walsh wrote:
    > > *Blink*. Really? I would not have expected language fixup to do that,
    > > but maybe it does. So xml:lang="" is equivalent to $default-language,
    > > I suppose.
    >
    > Well, I don't know if this is what XInclude spec says but IIRC there were some XInclude processors that did that.


    As I understand the XML specification, the meaning of an empty "xml:lang" attribute is defined as overriding any language inherited from the parent element and reverting to the processor default. So it might make sense that if no language is indicated in an included file, it is taken as unspecified and explicitly marked as such in the larger context where it's included.

    https://www.w3.org/TR/2008/REC-xml-20081126/#sec-lang-tag


    ********************************
    Rob Cavicchio
    rcavicch@opentext.com





  • 11.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-08-2023 18:48
    > As I understand the XML specification, the meaning of an empty
    > "xml:lang" attribute is defined as overriding any language inherited
    > from the parent element and reverting to the processor default. So it
    > might make sense that if no language is indicated in an included file,
    > it is taken as unspecified and explicitly marked as such in the larger
    > context where it's included.

    Righto. A detail that had slipped my memory. I see a 2.0.8 in my future!
    Thank you!

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > We judge ourselves by what we feel capable of doing, while others judge
    > us by what we have already done.--Henry Wadsworth Longfellow



  • 12.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-09-2023 00:11
    On 07/02/2023 14:00, Jirka Kosek wrote:
    > On 07.02.2023 9:53, Norm Tovey-Walsh wrote:
    >> *Blink*. Really? I would not have expected language fixup to do that,
    >> but maybe it does. So xml:lang="" is equivalent to $default-language,
    >> I suppose.
    >
    > Well, I don't know if this is what XInclude spec says but IIRC there
    > were some XInclude processors that did that.

    I've just read that part of the XInclude spec [1], and I'm not sure that
    I know what it says, either, but it's clear that the 'language fixup' is
    able to create 'xml:lang=""' in some circumstances.

    Regards,


    Tony Graham.
    --
    Senior Architect
    XML Division
    Antenna House, Inc.
    ----
    Skerries, Ireland
    tgraham@antenna.co.jp


    [1] https://www.w3.org/TR/xinclude/#language



  • 13.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-11-2023 18:26
    Tony Graham <tgraham@antenna.co.jp> writes:
    > I've just read that part of the XInclude spec [1], and I'm not sure that
    > I know what it says, either, but it's clear that the 'language fixup' is
    > able to create 'xml:lang=""' in some circumstances.

    Yes. I think my XInclude implementation should ad xml:lang="" when the
    included file has no in-scope xml:lang. Broader discussion might start
    here: http://lists.xml.org/archives/xml-dev/202302/msg00016.html

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > It does not do harm to the mystery to know a little about it. For far
    > more marvelous is the truth than any artists of the past
    > imagined!--Richard Feynman



  • 14.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-07-2023 08:50
    Tony Graham <tgraham@antenna.co.jp> writes:
    > On 06/02/2023 18:58, Dave Pawson wrote:
    >> On Mon, 6 Feb 2023 at 18:48, Tony Graham <tgraham@antenna.co.jp> wrote:
    > ...
    >> Which begs the question, where to set the default language, and should
    >> it be reported as a bug if not set?
    >> [Guess, $gentext-language will default to 'default language' - does
    >> that make sense?]
    >
    > If you look at line 145, $default-language is used if there's no
    > $gentext-language and no @xml:lang. An empty @xml:lang would be used
    > ahead of $default-language and would result in those empty values in the
    > error message.

    There’s a hierarchy:

    1. If you specify $gentext-language, that’s used. End of story. You want
    all the generated text to be in Thai even though the book claims to
    be in German, you got it. Why, I don’t know.
    2. Otherwise, if you specify a language, that’s used.
    3. Otherwise, the $default-language is used.

    If there’s a use case for xml:lang="", I don’t know what it is.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > There is only one difference between a madman and me. I am not
    > mad.--Salvador Dali



  • 15.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-07-2023 08:47
    > The 'terminate="yes"' on line 168 does rather contradict the message
    > that processing will continue with the default language.

    Yeah. That seems like a bug. Perhaps I did that when I was trying to
    debug and forgot to take it out.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > Of all lies, art is the least untrue.--Flaubert



  • 16.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-07-2023 20:09
    Hi,

    On 06.02.23 19:48, Tony Graham wrote:
    > On 06/02/2023 15:23, Thomas Schraitle wrote:
    > ...
    >> No localization exists for "" or "". Using default "en".
    >> Error at xsl:text on line 169 column 19 of functions.xsl:
    >>    XTMM9000  Processing terminated by xsl:message at line 169 in functions.xsl
    >
    > Do you have any 'xml:lang=""' in your document(s)?

    No, not that I'm aware of it. All xml:lang are set correctly. But thanks for
    the suggestion.


    > [...]



    --
    Gruß/Regards
    Thomas Schraitle




  • 17.  Re: [docbook-apps] DocBook xslTNG prerelease 2.0.7

    Posted 02-11-2023 18:25
    > No localization exists for "" or "". Using default "en".
    > Error at xsl:text on line 169 column 19 of functions.xsl:
    > XTMM9000 Processing terminated by xsl:message at line 169 in
    > functions.xsl

    Fixed in 2.0.8 just released. The termination was a bug, probably left
    over from when I was debugging in earnest. I’ve also patched the
    function so that xml:lang="" is an explicit request for the default
    language which it selects without raising any warnings.

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > We have fewer friends than we imagine, but more than we know.--Hugo Von
    > Hofmannsthal