|
List Info
Thread: ulink doesn't show as footnote when using XSL-NS Stylesheets
|
|
| ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-08-30 13:03:04 |
|
DocBook v5 replaces ulink with link as documented in DocBook V5.0:The Transition Guide. It looks like the XSL-NS Stylesheets are not handling ulink.footnotes
though; 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
|
|
|
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-08-31 02:46:57 |
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-a
pps/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/
|
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-08-31 06:33:54 |
|
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">
smith sideshowbarker.net> wrote:Ken Morse < kenneth.morse gmail.com">
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 Jeanson9;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/
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-08-31 08:27:34 |
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
|
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-09-05 14:25:53 |
|
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">smith sideshowbarker.net> wrote:
Ken Morse < kenneth.morse gmail.com">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
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-09-06 07:01:57 |
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
|
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-09-06 09:38:17 |
|
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:
- 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).
- 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">smith sideshowbarker.net> wrote:
Ken Morse < kenneth.morse gmail.com">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
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-09-10 12:02:32 |
|
Very cool Mike! I'll check out the changes and see how they work out with my docs.
Thanks for all the hard work, Ken
On 9/10/07, Michael(tm) Smith
< smith sideshowbarker.net">smith sideshowbarker.net> wrote:
On 9/6/07, Ken Morse < kenneth.morse gmail.com">kenneth.morse gmail.com> wrote: > The additional twist I've found to this is that even with the patch, the > footnote numbers are not output.
Yeah, after looking at the code a bit, I could see that this problem is a bit more complicated than I had first thought. One issue is that link is not the only element in DocBook 5 that can be used to mark up hyperlinks; the xlink:href element is allowed
on all (or almost all) elements -- which means that any element in DocBook 5 can potentially generate a hyperlink.
The existing XSL stylesheets already supported generating hyperlinks for elements other than the "linking" elements (ulink,
link, olink) -- not for all elements, but at least for most inline ones (I think the template that causes the hyperlinks to be generated, the simple.xlink template, currently gets called only for inline elements that are processed using the various inline.*
named templates.
The problem is that the simple.xlink template was not called the same hyperlink-display code that the ulink template was calling. So I updated the simple.xlink template to do that, and also update
the xsl:number instances that generate the footnote numbers. So now, at least for the cases I've tested so far, footnote numbers do get generated as expected for hyperlinked inline elements (including the link element).
So please either download the latest snapshot or use the attached patch to update youe 1.73.2 stylesheets, then test and let me know if it works for you as expected.
> 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).
Yeah, the XPath expression for determing whether a particular xlink:href instance is an external link or not is a bit
complicated; take a look at the patch. I'm not certain I got it completely right yet, so we may need to make some further refinements to it after more testing gets done.
> 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?
I have been testing the generated XSL-NS stylesheets in my workspace and they seem to now be working as expected after the change I made. But if you test and find any problems, definitely let me know.
--Mike
|
| Re: ulink doesn't show as footnote when
using XSL-NS Stylesheets |

|
2007-09-16 15:30:38 |
|
Hi Mike,
I had a chance to test out the changes you made and so far everything looks very good. I tested the snapshot XSL stylesheets against both DocBook 4 and DocBook5 and also tested the XSL-NS stylesheets against DocBook 5. Both the links and the footnotes are now working properly.
Thanks Mike!
Ken
On 9/10/07, Michael(tm) Smith < smith sideshowbarker.net">smith sideshowbarker.net> wrote:
On 9/6/07, Ken Morse < kenneth.morse gmail.com">kenneth.morse gmail.com
> wrote: > The additional twist I've found to this is that even with the patch, the > footnote numbers are not output.
Yeah, after looking at the code a bit, I could see that this problem is a bit more complicated than I had first thought. One
issue is that link is not the only element in DocBook 5 that can be used to mark up hyperlinks; the xlink:href element is allowed on all (or almost all) elements -- which means that any element in DocBook 5 can potentially generate a hyperlink.
The existing XSL stylesheets already supported generating hyperlinks for elements other than the "linking" elements (ulink, link, olink) -- not for all elements, but at least for most inline ones (I think the template that causes the hyperlinks to be
generated, the simple.xlink template, currently gets called only for inline elements that are processed using the various inline.* named templates.
The problem is that the simple.xlink template was not called the
same hyperlink-display code that the ulink template was calling. So I updated the simple.xlink template to do that, and also update the xsl:number instances that generate the footnote numbers. So now, at least for the cases I've tested so far, footnote numbers
do get generated as expected for hyperlinked inline elements (including the link element).
So please either download the latest snapshot or use the attached patch to update youe 1.73.2 stylesheets, then test and let me know
if it works for you as expected.
> 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).
Yeah, the XPath expression for determing whether a particular xlink:href instance is an external link or not is a bit complicated; take a look at the patch. I'm not certain I got it completely right yet, so we may need to make some further
refinements to it after more testing gets done.
> 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?
I have been testing the generated XSL-NS stylesheets in my workspace and they seem to now be working as expected after the
change I made. But if you test and find any problems, definitely let me know.
--Mike
|
[1-9]
|
|