Re: [docbook-apps] insert.link.page.number in xsl stylesheets

2021-06-15 Thread Dave Pawson
Perhaps look up template overrides? Bobs site again.
Hth

On Tue, 15 Jun 2021 at 16:07, Kevin Dunn  wrote:

> Thanks. Changing the default worked for both xref and link. I could not
> make a custom "mystyle" style work with either of them. That's fine. I
> would prefer to have the same style throughout a document, except when I
> don't want a page reference. "nopage" works for both xrefs and links, so
> now I'm able to do everything I want to do.
>
> FYI, when I tried to use a custom "mystyle", both xref and link gave me
> the default style. xref recognizes page, Page, pageabbrev, pagenumber, and
> nopage. Anything else (including "mystyle") gives the default. link
> recognizes only nopage. Anything else gives the default.
> --
> *From:* Bob Stayton 
> *Sent:* Tuesday, June 15, 2021 2:25 AM
> *To:* Kevin Dunn ; docbook-apps@lists.oasis-open.org <
> docbook-apps@lists.oasis-open.org>
>
> *Subject:* Re: [docbook-apps] insert.link.page.number in xsl stylesheets
>
>
> Hi Kevin,
>
> Indeed, it looks like the "select:" mechanism in @xrefstyle was never
> implemented for link element page references, only for xrefs.  This will
> require customizing the generated text instead.  See
> http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText
>
>
> You can change the default (unspecified) style by adding this to your
> customization layer:
>
>
> 
> http://docbook.sourceforge.net/xmlns/l10n/1.0;
> >
>   
> 
>   
> 
>   
> 
>
>
> If you don't want to alter the default style, the named style mechanism
> does work, so you could add a this  instead (note the @style attribute):
>
> .
>
> 
> http://docbook.sourceforge.net/xmlns/l10n/1.0;
> >
>   
> 
>   
> 
>   
> 
>
>
> Then you would get your style if you specify ,
> otherwise you get the default.
>
> Bob staytonb...@sagehill.net
>
> On 6/14/2021 8:27 PM, Kevin Dunn wrote:
>
> Putting "'yes'" (single in double quotes) in the param statement got the
> links to put out page numbers. I guess that's what I get for reading
> Chapter 15 before Chapter 1. But links put out the "unspecified" page
> style, no matter what xrefstyle is set to. I tried:
>
> A Chapter link
>
> A Chapter link
>
> A Chapter link
>
> A Chapter link
>
> A Chapter link
>
> In all five cases, the rendering was:
> A Chapter link [15]
>
> Interestingly, xref and link behave differently when it comes to quotes,
> and I can see that they are treated differently in xref.xsl.
> --
> *From:* Bob Stayton  
> *Sent:* Monday, June 14, 2021 5:00 PM
> *To:* docbook-apps@lists.oasis-open.org
>  
> *Subject:* Re: [docbook-apps] insert.link.page.number in xsl stylesheets
>
>
> I think the problem is in the param statement, where the string yes is
> being interpreted as an element name.
>
>
> 
>
>
> (I added single quotes around the word yes).
>
> Bob staytonb...@sagehill.net
>
> On 6/14/2021 12:05 PM, Kevin Dunn wrote:
>
> I'm customizing xrefs to render page numbers in pdf files for print.
> Setting insert.xref.page.number to yes, and using an xrefstyle attribute, I
> can get the desired output, e.g. "See Appendix B (page 127)."
>
> Page number for links do not work as I would expect from reading
> http://www.sagehill.net/docbookxsl/CustomXrefs.html.
>
> In my custom xsl, I have both:
> 
> 
>
> My xml file contains both:
> 
> A Chapter link
>
> The fo from xsltproc renders page numbers for the xref, but not for the
> link. The behavior is the same using version 1.79.1 stylesheet and the
> snapshot/2020-06-03. Fop, xep, and axf produce PDFs with working links, but
> rendered page numbers only for the xrefs.
>
> I may be misreading the documentation or misunderstanding the xsl (very
> possible). The xsl is different for xref and link in xref.xsl, but to my
> untrained eye, both look reasonable.
>
> Any suggestions?
>
> --
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.


Re: [docbook-apps] insert.link.page.number in xsl stylesheets

2021-06-15 Thread Kevin Dunn
Thanks. Changing the default worked for both xref and link. I could not make a 
custom "mystyle" style work with either of them. That's fine. I would prefer to 
have the same style throughout a document, except when I don't want a page 
reference. "nopage" works for both xrefs and links, so now I'm able to do 
everything I want to do.

FYI, when I tried to use a custom "mystyle", both xref and link gave me the 
default style. xref recognizes page, Page, pageabbrev, pagenumber, and nopage. 
Anything else (including "mystyle") gives the default. link recognizes only 
nopage. Anything else gives the default.

From: Bob Stayton 
Sent: Tuesday, June 15, 2021 2:25 AM
To: Kevin Dunn ; docbook-apps@lists.oasis-open.org 

Subject: Re: [docbook-apps] insert.link.page.number in xsl stylesheets


Hi Kevin,

Indeed, it looks like the "select:" mechanism in @xrefstyle was never 
implemented for link element page references, only for xrefs.  This will 
require customizing the generated text instead.  See 
http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText


You can change the default (unspecified) style by adding this to your 
customization layer:



http://docbook.sourceforge.net/xmlns/l10n/1.0;>
  

  

  



If you don't want to alter the default style, the named style mechanism does 
work, so you could add a this  instead (note the @style attribute):

.


http://docbook.sourceforge.net/xmlns/l10n/1.0;>
  

  

  



Then you would get your style if you specify , 
otherwise you get the default.

Bob Stayton
b...@sagehill.net

On 6/14/2021 8:27 PM, Kevin Dunn wrote:
Putting "'yes'" (single in double quotes) in the param statement got the links 
to put out page numbers. I guess that's what I get for reading Chapter 15 
before Chapter 1. But links put out the "unspecified" page style, no matter 
what xrefstyle is set to. I tried:

A Chapter link

A Chapter link

A Chapter link

A Chapter link

A Chapter link

In all five cases, the rendering was:
A Chapter link [15]

Interestingly, xref and link behave differently when it comes to quotes, and I 
can see that they are treated differently in xref.xsl.

From: Bob Stayton 
Sent: Monday, June 14, 2021 5:00 PM
To: docbook-apps@lists.oasis-open.org 

Subject: Re: [docbook-apps] insert.link.page.number in xsl stylesheets


I think the problem is in the param statement, where the string yes is being 
interpreted as an element name.





(I added single quotes around the word yes).

Bob Stayton
b...@sagehill.net

On 6/14/2021 12:05 PM, Kevin Dunn wrote:
I'm customizing xrefs to render page numbers in pdf files for print. Setting 
insert.xref.page.number to yes, and using an xrefstyle attribute, I can get the 
desired output, e.g. "See Appendix B (page 127)."

Page number for links do not work as I would expect from reading 
http://www.sagehill.net/docbookxsl/CustomXrefs.html.

In my custom xsl, I have both:



My xml file contains both:

A Chapter link

The fo from xsltproc renders page numbers for the xref, but not for the link. 
The behavior is the same using version 1.79.1 stylesheet and the 
snapshot/2020-06-03. Fop, xep, and axf produce PDFs with working links, but 
rendered page numbers only for the xrefs.

I may be misreading the documentation or misunderstanding the xsl (very 
possible). The xsl is different for xref and link in xref.xsl, but to my 
untrained eye, both look reasonable.

Any suggestions?


Re: [docbook-apps] insert.link.page.number in xsl stylesheets

2021-06-15 Thread Bob Stayton

Hi Kevin,

Indeed, it looks like the "select:" mechanism in @xrefstyle was never 
implemented for link element page references, only for xrefs. This will 
require customizing the generated text instead.  See 
http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText



You can change the default (unspecified) style by adding this to your 
customization layer:




http://docbook.sourceforge.net/xmlns/l10n/1.0;>
  
    
  
    
  



If you don't want to alter the default style, the named style mechanism 
does work, so you could add a this  instead (note the @style attribute):


.


http://docbook.sourceforge.net/xmlns/l10n/1.0;>
  
    
  
    
  



Then you would get your style if you specify , 
otherwise you get the default.


Bob Stayton
b...@sagehill.net

On 6/14/2021 8:27 PM, Kevin Dunn wrote:
Putting "'yes'" (single in double quotes) in the param statement got 
the links to put out page numbers. I guess that's what I get for 
reading Chapter 15 before Chapter 1. But links put out the 
"unspecified" page style, no matter what xrefstyle is set to. I tried:


A Chapter link

A Chapter link

A Chapter link

A Chapter link

A Chapter link

In all five cases, the rendering was:
A Chapter link [15]

Interestingly, xref and link behave differently when it comes to 
quotes, and I can see that they are treated differently in xref.xsl.


*From:* Bob Stayton 
*Sent:* Monday, June 14, 2021 5:00 PM
*To:* docbook-apps@lists.oasis-open.org 


*Subject:* Re: [docbook-apps] insert.link.page.number in xsl stylesheets

I think the problem is in the param statement, where the string yes is 
being interpreted as an element name.






(I added single quotes around the word yes).

Bob Stayton
b...@sagehill.net  
On 6/14/2021 12:05 PM, Kevin Dunn wrote:
I'm customizing xrefs to render page numbers in pdf files for print. 
Setting insert.xref.page.number to yes, and using an xrefstyle 
attribute, I can get the desired output, e.g. "See Appendix B (page 
127)."


Page number for links do not work as I would expect from 
readinghttp://www.sagehill.net/docbookxsl/CustomXrefs.html 
.


In my custom xsl, I have both:



My xml file contains both:

A Chapter link

The fo from xsltproc renders page numbers for the xref, but not for 
the link. The behavior is the same using version 1.79.1 stylesheet 
and the snapshot/2020-06-03. Fop, xep, and axf produce PDFs with 
working links, but rendered page numbers only for the xrefs.


I may be misreading the documentation or misunderstanding the xsl 
(very possible). The xsl is different for xref and link in xref.xsl, 
but to my untrained eye, both look reasonable.


Any suggestions?