docbook-apps

  • 1.  ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 08-30-2007 18:03
      |   view attached
    DocBook v5 replaces ulink with link as documented in DocBook V5.0:The
    Transition Guide <http: docbook.org/docs/howto/2006-10-22/#changes-renamed="">.
    It looks like the XSL-NS Stylesheets are not handling
    ulink.footnotesthough; setting the parameter to 1 doesn't cause the
    link to show up as a
    footnote.

    I've attached a small sample v5 document and two sample stylesheets -- the
    XSL stylesheet works as expected (the footnote shows up) and the XSL-NS does
    not. I can report this as a bug but wanted to see if anyone else ran into
    the problem.

    I'm using the 1.73.2 versions of the stylesheets.

    Ken

    </http:>

    Attachment(s)

    xml
    testbook.xml   707 B 1 version


  • 2.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 08-31-2007 07:47
    Ken Morse <kenneth.morse@gmail.com>, 2007-08-30 14:03 -0400:

    > DocBook v5 replaces ulink with link as documented in DocBook V5.0:The
    > Transition Guide <http://docbook.org/docs/howto/2006-10-22/#changes-renamed>.
    > It looks like the XSL-NS Stylesheets are not handling
    > ulink.footnotesthough; setting the parameter to 1 doesn't cause
    > the link to show up as a footnote.

    See Mauritz Jeanson's related message:

    http://www.oasis-open.org/archives/docbook-apps/200708/msg00244.html

    To quote that:

    In the XSL-NS version of html/xref.xsl, @target is supposed to
    be assigned a value in the template with match="d:ulink".
    But that template is never applied, since there is no ulink
    element in DocBook 5.

    So it seems we probably need to make an adjustment to the XSL-NS
    build, to convert that match="d:ulink" template into one that
    handles link instances that are used in that same context.

    We will most likely not be doing a 1.73.3 release. So that fix,
    once it gets made, will probably not be available in an official
    release until 1.74.0, which could be a while. So in the mean time,
    it will probably require you to either use a snapshot containing
    the fix, or to patch your local 1.73.2 copies.

    Anyway, I suspect we will have a fix for this checked in within
    the next couple of days.

    --Mike

    --
    Michael(tm) Smith
    http://people.w3.org/mike/
    http://sideshowbarker.net/



  • 3.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 08-31-2007 11:34
    Bug is checked in, https://sourceforge.net/support/tracker.php?aid=1785519.

    If I learn anything more, or determine a fix, I'll post an update.

    Is there anyway to add "XSL-NS" as a category in the bug tracker?

    Thanks,
    Ken


    On 8/31/07, Michael(tm) Smith <smith@sideshowbarker.net> wrote:
    >
    > Ken Morse <kenneth.morse@gmail.com>, 2007-08-30 14:03 -0400:
    >
    > > DocBook v5 replaces ulink with link as documented in DocBook V5.0:The
    > > Transition Guide <
    > http://docbook.org/docs/howto/2006-10-22/#changes-renamed>.
    > > It looks like the XSL-NS Stylesheets are not handling
    > > ulink.footnotesthough; setting the parameter to 1 doesn't cause
    > > the link to show up as a footnote.
    >
    > See Mauritz Jeanson's related message:
    >
    > http://www.oasis-open.org/archives/docbook-apps/200708/msg00244.html
    >
    > To quote that:
    >
    > In the XSL-NS version of html/xref.xsl, @target is supposed to
    > be assigned a value in the template with match="d:ulink".
    > But that template is never applied, since there is no ulink
    > element in DocBook 5.
    >
    > So it seems we probably need to make an adjustment to the XSL-NS
    > build, to convert that match="d:ulink" template into one that
    > handles link instances that are used in that same context.
    >
    > We will most likely not be doing a 1.73.3 release. So that fix,
    > once it gets made, will probably not be available in an official
    > release until 1.74.0, which could be a while. So in the mean time,
    > it will probably require you to either use a snapshot containing
    > the fix, or to patch your local 1.73.2 copies.
    >
    > Anyway, I suspect we will have a fix for this checked in within
    > the next couple of days.
    >
    > --Mike
    >
    > --
    > Michael(tm) Smith
    > http://people.w3.org/mike/
    > http://sideshowbarker.net/
    >
    >



  • 4.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 08-31-2007 13:28
    Ken Morse <kenneth.morse@gmail.com>, 2007-08-31 07:33 -0400:

    > Bug is checked in, https://sourceforge.net/support/tracker.php?aid=1785519.
    > If I learn anything more, or determine a fix, I'll post an update.

    Thanks

    > Is there anyway to add "XSL-NS" as a category in the bug tracker?

    There is a way, but I'm reluctant to do that at this point,
    because it will mean that when we search or run reports for open
    bugs for the stylesheets, we need to run the report against two
    categories instead of just one. For now at least, I think it's
    probably better to just have the XSL and XSL-NS stylesheets
    treated in the same category as far as SF bug tracking goes.

    --Mike



  • 5.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 09-05-2007 19:26
    I figured out what was happening and attached a patch to the issue in the
    bugtracker. When the XSL stylesheets detect a 5.0 document (using
    namespace), the stripns.xsl stylesheet converts a link to a ulink if the
    link points to an external reference. The XSL-NS stylesheets have no such
    conversion so link (in fo/xref.xsl) has been patched to call the ulink
    template if the link points to an external reference.

    Although I built a patch for the xref.xsl file, I'm not sure this is helpful
    since I don't know how the XSL-NS Stylesheets are currently built. If they
    are still built by transforming the XSL stylesheets then a special
    transformation for link in fo/xref.xsl would need to be added.

    Ken


    On 8/31/07, Michael(tm) Smith <smith@sideshowbarker.net> wrote:
    >
    > Ken Morse <kenneth.morse@gmail.com>, 2007-08-31 07:33 -0400:
    >
    > > Bug is checked in,
    > https://sourceforge.net/support/tracker.php?aid=1785519.
    > > If I learn anything more, or determine a fix, I'll post an update.
    >
    > Thanks
    >
    > > Is there anyway to add "XSL-NS" as a category in the bug tracker?
    >
    > There is a way, but I'm reluctant to do that at this point,
    > because it will mean that when we search or run reports for open
    > bugs for the stylesheets, we need to run the report against two
    > categories instead of just one. For now at least, I think it's
    > probably better to just have the XSL and XSL-NS stylesheets
    > treated in the same category as far as SF bug tracking goes.
    >
    > --Mike
    >
    >



  • 6.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 09-06-2007 12:02
    Ken Morse <kenneth.morse@gmail.com>, 2007-09-05 15:25 -0400:

    > I figured out what was happening and attached a patch to the issue in the
    > bugtracker. When the XSL stylesheets detect a 5.0 document (using
    > namespace), the stripns.xsl stylesheet converts a link to a ulink if the
    > link points to an external reference. The XSL-NS stylesheets have no such
    > conversion so link (in fo/xref.xsl) has been patched to call the ulink
    > template if the link points to an external reference.

    I see -- so more specifically, it looks like your patch causes the
    template for the DocBook-namespaced link element to checks and see
    if any link has an xlink:href or href attribute; if it finds one
    that does, and the href value is non-empty and doesn't start with
    a hash sign, then it calls the ulink template and passes the href
    value as the value of the url parameter for that template.

    And if it doesn't find an xlink:href or href attribute at all, the
    link template just does the same thing it's already doing now.

    So that all looks correct to me.

    > Although I built a patch for the xref.xsl file, I'm not sure this is helpful
    > since I don't know how the XSL-NS Stylesheets are currently built. If they
    > are still built by transforming the XSL stylesheets

    They are still build for the non-namespaced XSL stylesheets and
    are likely to continue to be built that way for as long as they
    continue to be maintained and available (which is probably means
    until we moved over completely to a set of natively
    namespace-aware XSLT 2.0 stylesheets).

    > then a special transformation for link in fo/xref.xsl would need
    > to be added.

    Actually, I think we can probably just add your patch (or
    something the achieves the same effect) to the non-namespaced
    XSL stylesheets source. Though it's true that in DocBook 4 and
    before, xlink:href and href are not valid attributes on link, the
    XSL stylesheets don't need to be limited to processing only what's
    valid in DocBook 4. If we add the check for href to the XSL
    stylesheet source, I think it may just get copied over unchanged
    to the corresponding template in the generated XSL-NS stylesheets
    -- and that check for href will be harmless as far as processing
    instances of DocBook 4 and before, because the code will just
    never get exercised (always evaluate to false) when processing
    valid instances DocBook 4 and before.

    But I'll need to try adding it and then running the XSL-NS build
    to see if that's actually the case or not. If it's not, then I
    think Bob (who's the one that created the XSL-NS build) will need
    to take a look at it and figure what needs to be done.

    --Mike



  • 7.  Re: [docbook-apps] ulink doesn't show as footnote when using XSL-NS Stylesheets

    Posted 09-06-2007 14:38
    Thanks for the explanation on this Mike.

    The additional twist I've found to this is that even with the patch, the
    footnote numbers are not output. I believe this is do to the following
    section of the ulink.footnote.number template in fo/xref.xsl:

    <xsl:number level="any"

    from="d:chapter|d:appendix|d:preface|d:article|d:refentry|d:bibliography[not(parent::d:article)]"


    count="d:footnote[not(@label)][not(ancestor::d:tgroup)]|d:ulink[node()][@url
    != .][not(ancestor::d:footnote)]"
    format="1"/>

    We can replace the ulink with link for the XSL-NS stylesheets but that
    raises a couple of questions:

    1. How can we change the footnote number so that links to external
    sites are counted, but internal links are not? (I'm not familiar enough with
    XPATH expressions and predicates to do this properly).
    2. If we do change the non-namespaced XSL stylesheets source as you
    suggest, then the footnote count would need to handle both ulink (as it does
    now) as well as handling the link changes. Can we do this with a single
    <xsl:number.../> or would we have to split things up?

    Ken

    On 9/6/07, Michael(tm) Smith <smith@sideshowbarker.net> wrote:
    >
    > Ken Morse <kenneth.morse@gmail.com>, 2007-09-05 15:25 -0400:
    >
    > > I figured out what was happening and attached a patch to the issue in
    > the
    > > bugtracker. When the XSL stylesheets detect a 5.0 document (using
    > > namespace), the stripns.xsl stylesheet converts a link to a ulink if the
    > > link points to an external reference. The XSL-NS stylesheets have no
    > such
    > > conversion so link (in fo/xref.xsl) has been patched to call the ulink
    > > template if the link points to an external reference.
    >
    > I see -- so more specifically, it looks like your patch causes the
    > template for the DocBook-namespaced link element to checks and see
    > if any link has an xlink:href or href attribute; if it finds one
    > that does, and the href value is non-empty and doesn't start with
    > a hash sign, then it calls the ulink template and passes the href
    > value as the value of the url parameter for that template.
    >
    > And if it doesn't find an xlink:href or href attribute at all, the
    > link template just does the same thing it's already doing now.
    >
    > So that all looks correct to me.
    >
    > > Although I built a patch for the xref.xsl file, I'm not sure this is
    > helpful
    > > since I don't know how the XSL-NS Stylesheets are currently built. If
    > they
    > > are still built by transforming the XSL stylesheets
    >
    > They are still build for the non-namespaced XSL stylesheets and
    > are likely to continue to be built that way for as long as they
    > continue to be maintained and available (which is probably means
    > until we moved over completely to a set of natively
    > namespace-aware XSLT 2.0 stylesheets).
    >
    > > then a special transformation for link in fo/xref.xsl would need
    > > to be added.
    >
    > Actually, I think we can probably just add your patch (or
    > something the achieves the same effect) to the non-namespaced
    > XSL stylesheets source. Though it's true that in DocBook 4 and
    > before, xlink:href and href are not valid attributes on link, the
    > XSL stylesheets don't need to be limited to processing only what's
    > valid in DocBook 4. If we add the check for href to the XSL
    > stylesheet source, I think it may just get copied over unchanged
    > to the corresponding template in the generated XSL-NS stylesheets
    > -- and that check for href will be harmless as far as processing
    > instances of DocBook 4 and before, because the code will just
    > never get exercised (always evaluate to false) when processing
    > valid instances DocBook 4 and before.
    >
    > But I'll need to try adding it and then running the XSL-NS build
    > to see if that's actually the case or not. If it's not, then I
    > think Bob (who's the one that created the XSL-NS build) will need
    > to take a look at it and figure what needs to be done.
    >
    > --Mike
    >
    >