[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to trigger a new page sequence, depending on

Subject: Re: how to trigger a new page sequence, depending on specific input conditions
From: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Sun, 2 Oct 2011 13:11:58 +0100 (IST)
Re:  how to trigger a new page sequence
On Sun, October 2, 2011 1:44 am, team wise wrote:
> I am after a proper sort of method how to trigger a new page sequence,
> depending on specific input conditions.
> For example, as input, below is a content model XML with xtrf
> attribute featuring an unique identifier, such as GUID-1234,
> <concept>
>  <title xtrf="GUID-1234">
>   Explore and get support
>  </title>
>  <conbody/>
> </concept>

I, for one, am not sure what you are after.  What comes before and after
this <concept>?  Is it nested within several levels of elements or is it a
child of the document element?

If the <concept> is a child of the document element, then it might be as
simple as using xsl:for-each-group [1] with 'group-ending-with', e.g.:

<xsl:for-each-group
    select="*"
    group-ending-with="concept[title/@xtrf = 'GUID-1234']">
  <fo:page-sequence ...>
    ...
    <xsl:apply-templates select="current-group()" />
  </fo:page-sequence>
</xsl:for-each>

If you need to do this for multiple specific <context>, you can use a
sequence of @xtrf values in the predicate instead, e.g.:

   title/@xtrf = ('GUID-1234', 'GUID-5678')

> The intention is that the above XML content model shall be placed on

It's more commonly referred to as a 'fragment', BTW: 'content model' is a
term from DTDs for the definition of what's allowed in a particular
element.

> the last page of a PDF document with the following rendering effect
>
>   <xsl:if test="$outputformat = 'UG_Booklet_Print'">
>         <xsl:choose>
>           <xsl:when test="position() = last()">
>             <xsl:attribute name="axf:background-color"><xsl:value-of
> select="$background_colour"/></xsl:attribute>
>             <xsl:attribute
> name="color">rgb-icc(#CMYK,0%,0%,0%,0%)</xsl:attribute>
>           </xsl:when>

Presumably the 'last()' is for this particular <concept> only?

Regards,


Tony Graham                                   tgraham@xxxxxxxxxx
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL FO and XSLT consulting, training and programming

[1] http://www.w3.org/TR/xslt20/#xsl-for-each-group

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.