Re: [xsl] Bookmarks in xsl

Subject: Re: [xsl] Bookmarks in xsl
From: a kusa <akusa8@xxxxxxxxx>
Date: Wed, 5 Sep 2012 09:44:42 -0500
Thanks for your response Ken.

> The first bookmark of the entire set or the first bookmark of the chapter? - I meant the first bookmark of the chapter.

And when I said 'under' I meant nested bookmarks.

The problem I am having is that since the element 'task' can repeat
for a chapter, I am unable to generate the bookmark internal
destination ids to be unique. Since FOP does not support XSLT 1.0 (
and I restricted to this product),  I am not able to use the xslt 2.0
for-each-group to be able to group the tasks. I have to use keys to
group them. Is there any other better way of doing this?




On Tue, Sep 4, 2012 at 10:05 PM, G. Ken Holman
<gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> At 2012-09-04 19:37 -0500, a kusa wrote:
>>
>> Hello
>>
>> I have an XSLFO question that I am hoping can be answered here.
>>
>> I have an xml file with this structure:
>>
>> <tasks>
>>
>> <task chap="8" key"a123" seq="1" pg = "1">
>> <!-- some more content here-->
>> </task>
>>
>> <task chap="8" key"y837458" seq="2" pg = "2">
>> <!-- some more content here-->
>> </task>
>> <task chap="9" key"3jkhkj" seq="1" pg = "1">
>> <!-- some more content here-->
>> </task>
>> <task chap="9" key"t8798" seq="2" pg = "2">
>> <!-- some more content here-->
>> </task>
>> </tasks>
>>
>> The element task can repeat any number of times. Every task has the
>> four attributes chap, key, seq and pg.
>>
>> My requirement is to create a PDF using XSLFO and bookmarks with it.
>> The PDF bookmarks must be such that for each task[1] for each chap,
>> there will be a bookmark. Each task[2] or [3].. for each chap (in our
>> example pg 2, pg 3) will be a child bookmark under the first bookmark.
>
>
> The first bookmark of the entire set or the first bookmark of the chapter?
>
>
>> So, in the flow content, task[1] for chap 8 seq 1, pg 1 must display
>> content and must be linkable to the first PDF bookmark.
>> task[2] for chap 8, seq 2, pg 2 must display content and must be
>> linkable to the first child PDF bookmark of the first bookmark.
>> And so on....
>
>
> But you don't say what happens for task[3] ... and what do you mean by
> "under" the bookmark?  Do you mean when looking at all the bookmarks that
> "under" has the same indentation level or is "under" nested inside the
> parent?
>
> And if nested, how many parents are there?
>
>
>> Any suggestions on how to approach this?
>
>
> Are you asking what XSL-FO to use, or what XSLT to use to create the XSL-FO?
>
> You express siblings and nesting along the lines of:
>
>   <bookmark-tree>
>     <bookmark internal-destination="...">
>       <bookmark-title>...</bookmark-title>
>       <bookmark internal-destination="...">
>          <bookmark-title>...</bookmark-title>
>       </bookmark>
>     </bookmark>
>     <bookmark internal-destination="...">
>       <bookmark-title>...</bookmark-title>
>       <bookmark internal-destination="...">
>          <bookmark-title>...</bookmark-title>
>       </bookmark>
>     </bookmark>
>   </bookmark-tree>
>
>
>> I am using apache FOP as the processor.
>
>
> I don't use FOP so I don't know if it supports <bookmark-tree>.
>
> I hope this helps.
>
> . . . . . . . Ken
>
> --
> Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
> Contact us for world-wide XML consulting and instructor-led training
> Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
> G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Google+ profile: https://plus.google.com/116832879756988317389/about
> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

Current Thread