2010/6/18 Georg Datterl <[email protected]>: > 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
Well, it sounds good... I start from an XML file that is basically a speech report: thus there are several people speech. I can put an id on each tag opening the speech and follow the same approach, the only thing to do is extract the area tree results in XML and parse the result... I will try and post the results/problem for further considerations. Working on FOP Project can be a nice thing too :-) 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]
