I have another question. I have the same xml : <document> <pThis is a test</p> <table> <tr> <td>First TD</td> <td>Second TD</td> </tr> </table> <figure> <title>FIGURE 1</title> <g>GRAPHIC 1</g> </figure> <p>Paragraph n° 1 after figure 1</p> <p>Paragraph n° 2 after figure 1</p> <p>Other Text after figure 3 <figure> <title>FIGURE 2</title> <g>GRAPHIC 2</g> </figure> <p>Paragraph n° 1 after figure 2</p> <p>Paragraph n° 2 after figure 2</p> </p> <p>Paragraph n° 3 <u>underline tag</u>after figure 2</p> <f>Other TAG</f> <p> <figure> <title>FIGURE 3</title> <g>GRAPHIC 3</g> </figure>Text after figure 3 <p>Paragraph into onother Paragraph </p> </p> <p>Last paragraph</p> </document>
With the help of J.Pietschmann I succeed to create figure in A3 page and other tag in A4 page....but now I have the following problem: I have a repetition of each paragraph ...and this is no correct. Have you any ideas how can i resolve this problem? The pdf output it would have to be : - page A3 only the figure - page A4 the other tag - for each tag [i.e. <p><u><f> etc.etc] I wanted to use a specific template My code is this <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink"> <xsl:template match="document"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="pages-A4" page-height="11.69in" page-width="8.27in" margin-top="25pt" margin-bottom="20pt" margin-left="0.456in" margin-right="1.30in"> <fo:region-body region-name="region_body" margin-top="2.3cm" margin-bottom="4.4cm"/> </fo:simple-page-master> <fo:simple-page-master master-name="pages-A3" page-height="11.69in" page-width="16.54in" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm"> <fo:region-body region-name="region_body" margin-top="2.3cm" margin-bottom="4.4cm"/> </fo:simple-page-master> </fo:layout-master-set> <!-- content before the first figure element, or perhaps the only content --> <fo:page-sequence master-reference="pages-A4"> <fo:flow flow-name="region_body"> <fo:block text-align="center">BLABLABLABLA</fo:block> <fo:block font-family="Helvetica" font-size="10pt" text-align="justify"> <xsl:apply-templates select="node()[not(preceding-sibling::figure)]"/> </fo:block> </fo:flow> </fo:page-sequence> <xsl:for-each select="//figure"> <fo:page-sequence master-reference="pages-A3"> <fo:flow flow-name="region_body"> <fo:block text-align="center">FIGURE</fo:block> <fo:block font-family="Helvetica" font-size="10pt" text-align="justify"> <xsl:apply-templates select="."/> </fo:block> </fo:flow> </fo:page-sequence> <xsl:variable name="current-figure-node" select="following::figure[1]"/> <fo:page-sequence master-reference="pages-A4"> <fo:flow flow-name="region_body"> <fo:block font-family="Helvetica" font-size="10pt" text-align="justify"> <xsl:apply-templates select="following::node()[generate-id(following::figure[1])=generate-id($current-figure-node)]"/> </fo:block> </fo:flow> </fo:page-sequence> </xsl:for-each> </fo:root> </xsl:template> ****Template format***** <xsl:template match="p"> <fo:block font-family="Helvetica" font-size="10pt" text-align="justify"> <xsl:apply-templates select="node()"/> </fo:block> </xsl:template> <xsl:template match="u"> <fo:inline font-family="Helvetica" text-decoration="underline" > <xsl:apply-templates select="node()"/> </fo:inline> </xsl:template> <xsl:template match="f"> <fo:block font-family="Helvetica" font-size="10pt" text-align="justify" color="red"> <xsl:apply-templates select="node()"/> </fo:block> </xsl:template> with best regards, Fabio fabio76 wrote: > > Hi > Thanks for your reply. > I have correct only > <xsl:variable name="current-figure-node" select="."/> > with > <xsl:variable name="current-figure-node" > select="preceding-sibling::figure[1]"/> > Is correct? > Regards > Fabio > > > J.Pietschmann wrote: >> >> fabio76 wrote: >>> I have the following file xml : >>> >>> <document> >>> <pThis is a test</p> >>> <table> >>> <tr> >>> <td>First TD</td> >>> <td>Second TD</td> >>> </tr> >>> </table> >>> <figure> >>> <title>Figure Title</title> >>> </figure> >>> <p>Continue paragraf etc.etc.</p> >>> </document> >>> >>> Is possible to change the layout of the page when is applied the >>> template >>> <xsl:template match="figure"> ? >>> I would like to have the page in A3 only for the template 'figure', for >>> the >>> other template in A4 format >> >> You can start a new page sequence with an A3 page master. The >> unfortunate embedding of the 'figure' element will, however, lead >> to some not quite trivial XSLT code in order to generate the >> page sequences for the not-figure content. Note that this also >> means that 'figure' content gets its own page(s). XSL FO does >> not have the possibility to do page master change for pages >> containing some specific content embedded as usual in the flow. >> >> Try something along the following if you use an XSLT 1.0 processor >> (the solution in case of a 2.0 processor might be much simpler): >> <xsl:template match="document> >> <fo:root> >> <fo:layout-master-set> >> <fo:simple-page-master master-name="A4" ... >> ... >> </fo:simple-page-master> >> <fo:simple-page-master master-name="A3-landscape" ... >> ... >> </fo:simple-page-master> >> <fo:layout-master-set> >> <fo:root> >> <!-- content before the first figure element, or perhaps >> the only content --> >> <fo:page-sequence master-reference="A4"> >> ... define static content ... >> <fo:flow> >> <xsl:apply-templates select="node()[ >> not(preceding-sibling::figure)]"/> >> </fo:flow> >> </fo:page-sequence> >> <!-- now on for the figure elemets and groups of non-figure >> content after each figure element --> >> <xsl:for-each select="figure"> >> <!-- the figure element itself --> >> <fo:page-sequence master-reference="A3-landscape"> >> ... define static content ... >> <fo:flow> >> <xsl:apply-templates select="."/> >> </fo:flow> >> </fo:page-sequence> >> <xsl:variable name="current-figure-node" >> select="."/> >> <!-- the content after the figure element --> >> <fo:page-sequence master-reference="A4"> >> ... define static content ... >> <fo:flow> >> <xsl:apply-templates select="node()[ >> generate-id(preceding-sibling::figure[1])= >> generate-id($current-figure-node)]"/> >> </fo:flow> >> </fo:page-sequence> >> </xsl:for-each> >> </fo:root> >> </xsl:template> >> >> The code above is untested, non-optimal and may contain syntax errors. >> For more help, consult the XSLT FAQ and/or the XSL mailing list: >> http://www.mulberrytech.com/xsl/xsl-list/ >> >> J.Pietschmann >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Problem-change-layout-page-size-tf2912574.html#a8216377 Sent from the FOP - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]