xsl-list
[Top] [All Lists]

Re: How to count elements on a page

2002-11-30 12:32:30
Mete Kural wrote:
For example, I have a page with dictionary entries. I
want to have a footnote on the right bottom corner
that shows how many dictionary entries there is on
that specific page. For every page, there will be a
footnote telling the count of dictionary entries on
the page. How do I count the number of certain
elements - for instance <dictionary-entry> elements -
on a "page" and print the total count for that page as
a footnote on the page?

Short answer: you can't. Once the content gets into the
pagination process, there are no longer dictionary-entry
elements available for counting.
Longer answer: If you like challenges, try any of the
following:
- Implement pagination at the XSLT level. Whether this
  is workable depends on details of your problem, it has
  been done for dictionaries before.
- Implement extension elements for marking the dictionary
  entries and for counting the marks and print the result.
  Details depend heavily on the XSLFO processor you are
  using (for example, whether is supports extensiona at all).
- Check whether creative use of SVG graphics in FO markers
  or absolute positioned blocks solves your problem. The
  graphics may overlap, and by carefully placing dots
  and windows, the result could be the number you require.
  Similar tricks had been used in various toys and puzzles.

J.Pietschmann


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>