OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] Olinks in PDF missing valid destination?


Hi Bob, List,

I don't know if this a new thread or a continuation of what has been discussed below.  I set up some olinks on a set of very simple documents for testing purposes (only transformed to pdf at this stage) and they were working fine.  

However, I have now incorporated olinks into some larger documents and the pdf output is not as anticipated; in that following the occurrence of an xref element, no heading or para text is displayed for the remainder of that chapter - I do get the gentext of the first and subsequent cross-references and I do still get heading numbers, bullets, etc.  When I remove either the olink or the xref the document renders as expected.  I did think that it may have been a problem in my customization layer but I get the same results with the standard 1.72.0 stylesheets.  I also tested with the link element, when the link is an empty element I get the same problem, when the link element contains text, I do not.

As mentioned previously, I am using docbkx-tools 2.0.14 and FOP 1.0 with the 1.72.0 stylesheets.  I appreciate the issue may be with my tool chain and not the stylesheets and I have searched the web for other instances of this occurrence but cannot find any,  I was wondering if you or anyone else in the community had observed such behavior and could provide a fix.

Regards

Nick


-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net] 
Sent: Saturday, October 26, 2013 1:16 AM
To: Alexey Neyman; docbook-apps@lists.oasis-open.org
Cc: Wood Nick; Mark Craig
Subject: Re: [docbook-apps] Olinks in PDF missing valid destination?

Excellent, thanks for tracking that down and providing the fix.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Alexey Neyman" <stilor@att.net>
Sent: Friday, October 25, 2013 11:01 AM
To: <docbook-apps@lists.oasis-open.org>
Cc: "Wood Nick" <Nick.Wood@ncia.nato.int>; "Bob Stayton" 
<bobs@sagehill.net>; "Mark Craig" <mark.craig@gmail.com>
Subject: Re: [docbook-apps] Olinks in PDF missing valid destination?

> Hi Bob,
>
> Looks like the stylesheets could produce invalid link "url(#dest=)" if
> $fop1.extensions=1 and $insert.olink.pdf.frag=0. In that case, 
> make.olink.href template generates a string without '#something' 
> anchor. The code in olink template in fo/xref.xsl then tries to parse 
> this string as follows and
> fails:
>
>  <xsl:variable name="mybeg" select="substring-before($href,'#')"/>
>  <xsl:variable name="myend" select="substring-after($href,'#')"/>
>  <fo:basic-link
> external-destination="url({concat($mybeg,'#dest=',$myend)})"
>      xsl:use-attribute-sets="olink.properties">
>    <xsl:copy-of select="$hottext"/>
>  </fo:basic-link>
>
> If the $href does not contain #, both $mybeg and $myend would be 
> empty, leading to invalid URL '#dest='. Fix committed in r9825.
>
> Regards,
> Alexey.
>
>
> On Friday, October 25, 2013 12:37:54 am Wood Nick wrote:
>> Hi Bob,
>>
>> I am using docbkx-tools 2.0.14 with the 1.72.0 stylesheets.  You are 
>> correct, setting <insertOlinkPdfFrag>1</insertOlinkPdfFrag>in the POM 
>> is the same as <param name="insert.olink.pdf.frag" select="1"/> in 
>> the stylesheet.  I am using FOP 1.0 (we run Nexus behind a firewall 
>> and so updates are a challenge) which does not appear to support 
>> fragment identifiers.  From your response below I assume FOP 1.1 does?
>>
>> Regards
>>
>> Nick
>>
>>
>>
>> From: Mark Craig [mailto:mark.craig@gmail.com]
>> Sent: Thursday, October 24, 2013 8:52 PM
>> To: Bob Stayton
>> Cc: Wood Nick; DocBook Apps
>> Subject: Re: [docbook-apps] Olinks in PDF missing valid destination?
>>
>> Hi Bob,
>>
>> What I observed with <insertOlinkPdfFrag> left undefined -- I'm 
>> assuming that means insert.olink.pdf.frag is 0 -- I was getting 
>> external-destination="url(#dest=)" in the .fo. No file name, no fragment.
>>
>> I think docbkx-tools 2.0.14 is picking up version 1.76.1 stylesheets. 
>> What
>> I didn't do is get the stylesheets and try without docbkx-tools.
>>
>> Regards,
>> Mark
>>
>> On Thu, Oct 24, 2013 at 7:46 PM, Bob Stayton 
>> <bobs@sagehill.net<mailto:bobs@sagehill.net>> wrote: Hi Mark,
>> Can you clarify one point for me?   When <insertOlinkPdfFrag> is not set 
>> to
>> 1, does "not properly resolved" mean the link can open the other PDF 
>> document but not scroll to the proper location, or does it not open 
>> the other PDF at all?  I would expect the former.
>>
>> I'm not a user of docbkx-tools, but I presume setting 
>> <insertOlinkPdfFrag> is the same as setting the DocBook XSL 
>> stylesheet parameter named 'insert.olink.pdf.frag', right?  That 
>> parameter's default value should probably be 1, now that all XSL-FO 
>> processors support the fragment identifiers.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> bobs@sagehill.net<mailto:bobs@sagehill.net>
>>
>> From: Mark Craig<mailto:mark.craig@gmail.com>
>> Sent: Thursday, October 24, 2013 6:00 AM
>> To: Wood Nick<mailto:Nick.Wood@ncia.nato.int> ; DocBook 
>> Apps<mailto:docbook-apps@lists.oasis-open.org> Subject: Re:
>> [docbook-apps]
>> Olinks in PDF missing valid destination?
>>
>> By the way,
>>
>> When I want to resolve olinks between PDF documents, it looks like I 
>> also need <insertOlinkPdfFrag>1</insertOlinkPdfFrag>.
>>
>> Otherwise external-destinations are not properly resolved (though 
>> according to Olink debug messages they are resolved).
>>
>> Again, I'm seeing this behavior with 1.76.1.
>>
>> Regards,
>> Mark
>>
>> On Oct 23, 2013, at 3:38 PM, Mark Craig wrote:
>>
>>
>> Hi Nick,
>>
>> Thanks very much for your help.
>>
>> Following your suggestion does the trick:
>>
>> <currentDocid>book</currentDocid>
>>
>> As a result, the link gets resolved as an internal-destination in the 
>> .fo, and this works fine in the PDF.
>>
>> <fo:basic-link internal-destination="chapter"><fo:inline>link to the 
>> next chapter</fo:inline></fo:basic-link>.
>>
>> Regards,
>> Mark
>>
>> On Oct 23, 2013, at 2:35 PM, Wood Nick wrote:
>>
>>
>> Mark,
>>
>> I do not pretend to be an expert on this - I setup my pdf olinks 
>> using Bob's excellent book plus some guidance you have posted in the past.
>> However, have you tried adding <currentDocid/> in the 
>> <configuration/> of your POM and then using the sitemap in your 
>> olinkdb.xml (as I believe this provide the location of the 
>> documents).
>>
>> Regards
>>
>> Nick
>>
>>
>> From: Mark Craig
>> [mailto:mark.craig@gmail.com<mailto:mark.craig@gmail.com>]
>> Sent: Wednesday, October 23, 2013 10:11 AM
>> To: DocBook Apps
>> Subject: [docbook-apps] Olinks in PDF missing valid destination?
>>
>> Hello,
>>
>> In the past I have successfully set up Olink resolution for HTML.
>>
>> I have read and tried to implement
>> http://www.sagehill.net/docbookxsl/OlinkPrintOutput.html#PdfLinkingSe
>> tup But I'm not managing to do the same for PDF.
>>
>> A clickable link of the Olink is there in the PDF, but with no valid 
>> destination.
>>
>> This is with docbkx-tools 2.0.14, so DocBook XSL 1.76.1 and FOP 1 (I 
>> think 1.1).
>>
>> My little test is at https://github.com/markcraig/DOCS-47.
>> (There's only one Olink, in the para at line 20 of 
>> book.xml<https://github.com/markcraig/DOCS-47/blob/master/src/docbkx/book.
>> xml#L20>.)
>>
>> The main part of the target database
>> document<https://github.com/markcraig/DOCS-47/blob/master/src/docbkx/
>> olink
>> db.xml> for the test is minimal:
>>
>> <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE targetset[ ...
>> <!ENTITY book SYSTEM '../../target/target.db'> ]> <targetset>  
>> <document targetdoc="book" baseuri="book.pdf">&book;</document>
>> </targetset>
>>
>> Although Olink debug messages make it look like the stylesheets are 
>> finding a match for the link, the .fo is missing information.
>>
>> In the build output, I see:
>>
>> Olink debug: cases for targetdoc='book' and targetptr='chapter' in 
>> language ''. Olink debug: CaseA matched.
>> Olink debug: CaseA key is the final selection: book/chapter/
>>
>> But the .fo has an external-destination with no actual destination:
>>
>> <fo:basic-link show-destination="replace"
>> external-destination="url(#dest=)"
>>
>> ><fo:inline>link to the next chapter</fo:inline></fo:basic-link>
>>
>> If I remove the baseuri value from the <document> element in the 
>> target database document, then the external-destination attribute 
>> changes a
>> little:
>>
>> <fo:basic-link show-destination="replace"
>> external-destination="url(#dest=chapter)"
>>
>> ><fo:inline>link to the next chapter</fo:inline></fo:basic-link>
>>
>> What should I do differently for a valid destination to be generated?
>>
>> Thanks for your advice.
>> Regards,
>> Mark
>
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]