Hi Guiseppe,

This is one line of my index:
<fo:table-row>
  <fo:table-cell>
    <fo:block-container >
      <fo:block >
        Indexed Word
      </fo:block >
    </fo:block-container>
  </fo:table-cell>
  <fo:table-cell>
    <fo:block-container >
      <fo:block>
        <fo:inline>
          <fo:page-number-citation  ref-id="865"  
id="BE_38923893"></fo:page-number-citation>
          <fo:inline>, </fo:inline>
          <fo:page-number-citation  ref-id="876"  
id="BE_38923894"></fo:page-number-citation>
          <fo:inline>, </fo:inline>
          <fo:page-number-citation  ref-id="910"  
id="BE_38923895"></fo:page-number-citation>
          <fo:inline>, </fo:inline>
          <fo:page-number-citation  ref-id="912"  
id="BE_38923896"></fo:page-number-citation>
        </fo:inline>
      </fo:block>
    </fo:block-container>
  </fo:table-cell>
</fo:table-row>

As you can see, each fo:page-number-citation has an id. In my java code I have 
a Hashtable<"wiring word", Vector<"ids">>.

Transforming the fo file to area tree results in an XML where the IDs can be 
found again, together with the real page numbers. I transfer the XML to a dom 
document and use XPath evaluation to get the page numbers for each id from the 
hashtable:

String val = xPath.evaluate(".//te...@prod-id='BE_38923893']/word/text()", 
root, XPathConstants.STRING).toString();

val now contains the page number for the page-number-citation BE_38923893. If 
val for BE_38923894 contains the same page number, I know I can remove the whole

  <fo:inline>, </fo:inline>
  <fo:page-number-citation  ref-id="876"  
id="BE_38923894"></fo:page-number-citation>

from my fo file. This only works, of course, because I don't have to rely on 
transformations. But I'm quite sure the XSLT experts could come up with a 
transformation based solution as well. If you write out your fo file from code 
as well, I can give you some optimization hints as well, just ask then.

Regards,

Georg Datterl

------ Kontakt ------

Georg Datterl

Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg

HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20

www.geneon.de

Weitere Mitglieder der Willmy MediaGroup:

IRS Integrated Realization Services GmbH:    www.irs-nbg.de
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de


-----Ursprüngliche Nachricht-----
Von: Giuseppe Briotti [mailto:[email protected]]
Gesendet: Freitag, 18. Juni 2010 11:26
An: [email protected]
Betreff: Re: FOP, Index and duplicate Page number

Hi Pascal, hi Georg, thanks for your replies (very fast!).

Well, I can partecipate to FOP community trying to implement such
feature, but I don't know if I have the basic knowledge to do that:
I'm experienced developer in Java, C# and C/C++ thus probably I have
the "developing knowledge" but I don't know much about the FOP
implementation itself... can you suggest a starting point?

As symptom to my low knowledge about FOP, I have some doubt about the
Georg solution implementation... how can I do this: "Then I generate
the area tree for the document and look up the content of each ref-id
block. Finding blocks with identical content I delete all but one." I
agree that theory shows that this is the only available solution at
the moment, but I didn't find an example (well, I'm still searching,
of course: your answers were too fast! ;-) ).

So, in brief:

1. I have some time to spent in FOP Project collaboration and this
implementation probably is a good test for me, but I need a
documentation starting point (I've seen the wiki and travel through
the source code...);

2. the approach suggested by Georg sounds good for me, and again I
need an example, but probably I didn't search enough :-)

Thanks

G.

--

Giuseppe Briotti
[email protected]

"Alme Sol, curru nitido diem qui
promis et celas aliusque et idem
nasceris, possis nihil urbe Roma
visere maius."
(Orazio)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to