xsl-list
[Top] [All Lists]

Re: [xsl] Trying to use fo:page-number-citation to set the initial-page-number of the next page-sequence

2012-06-08 20:22:08
I just realized that I focused on your <xsl:when> error message and did not read the subject line of your email.

One cannot use the end result of citing a page number as the value for an initial page number in a page sequence.

What is the use case that prompted you to try and solve your issue with a page number citation? Perhaps there is another way to get what you need.

. . . . . . . . Ken

At 2012-06-08 21:19 -0400, I wrote:
At 2012-06-08 17:43 -0700, Underwood Michelle wrote:
XSL version: 1
Vendor: Microsoft
Vendor URL: http://www.microsoft.com

My question is: what will make this work, if anything?

Error: Unable to create a channel process for the channel 'Print'(2)
Nested Error: ... [4001] Failed to generate main XSL file used in Channel Assembly.
Nested Error: [4001] Failed to parse layout
Xsl:when is not allowed in this position in the stylesheet!
[4025]Filed to parse layout
Xsl:when is not allowed in this position in the stylesheet!
(And it repeats these last lines.)

Reviewing your code fragment, I'm led to believe the problem is elsewhere. I interpret the error message to be that <xsl:when> is being used not as a child of <xsl:choose>. In your code fragment, <xsl:choose> is the parent of both <xsl:when> instructions.

I grant the error message from the processor is not helping you find *which* statement is in error, but I suggest you find each <xsl:when> and check that its parent is <xsl:choose>.

Or just run this stylesheet on your stylesheet fragments to determine which fragments have the problem:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  version="1.0">
<xsl:template match="/">
  <xsl:value-of select="count(//xsl:when[not(parent::xsl:choose)])"/>
</xsl:template>
</xsl:stylesheet>

But you may have cut up your stylesheet inappropriately in trying to determine the fault ... I note this bizarre sequence in your fragment:

<xsl:attribute name="initial-page-number">
<xsl:value-of select="'fo:page-number-citation ref-id='TH_BlankPage' xmlns:fo='http://www.w3.org/1999/XSL/Format''"/>
</xsl:attribute>

Unrelated to your question, for performance reasons on some processors you might wish to review your use of "//" in the following:

<xsl:apply-templates select="//region[@name='ResponseFooter']" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; />
...
<xsl:apply-templates select="//region[@name='ResponseBody']" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; />

I hope you find this helpful.

. . . . . . . . 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(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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