Re: [xep-support] Double Page Numbering Revisited

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Thu Mar 30 2006 - 16:50:48 PST

At 2006-03-30 17:39 -0600, Steve Ylvisaker wrote:
>I have done this by putting a marker at the end of the document.

The original poster implied there was a number of series of slides in
a single publishing run, such that this would not work ... you would
only get the slide count of the last series.

>For example put an empty block as the last item of content and
>giving it an id attribute.
>
>for example
>
><fo:page-number-citation ref-id="theend"/> (this generates the page
>number of the last page)
>...
><fo:block id="theend"/> (this goes at the very end of the document)

Note the above approach is susceptible to collision with authored id=
values in the user input XML. What if the user authored an
id="theend" in their own XML and the stylesheet copied that into the
FO tree? Then there would be a collision.

The same issue arises when you are aggregating multiple XML documents
(each with their own independent use of id=) into a single formatted
result ... you cannot just copy the authored id= into the FO tree.

I recommend to my students, and it is in my book, that authored
elements with id= attributes are given the generate-id() value for
id= in the FO tree. That way, even if two aggregated XML documents
have the same id= they will have different id= values in the FO tree
and you don't get a collision.

But that still leaves "what to do with the id= to choose at the
end"? I suggest using generate-id(/) for the anchor at the end of
the flow because, even in an aggregated publication, it is impossible
for any idref= to point to the root node (since it isn't an element),
so you are guaranteed that your page count anchor is independent from
any authored anchor, while authored anchors in each file are
independent from authored anchors in other files.

>If you have the O'Reilly book by Dave Pawson see page 173

I see in the prose on that page that Dave's approach does not address
issues of ambiguity or aggregation.

If you have the paper edition of my book (on store bookshelves) my
proposed method above is on page 99, and in the electronic edition of
my book (for sale on our web site; a free excerpt can be downloaded
at no charge) it is on page 98.

I hope this helps.

. . . . . . . . Ken

--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/f/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Thu Mar 30 17:17:37 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 30 2006 - 17:17:38 PST