Re: Problem change layout page size

2007-11-28 Thread fabio76

Hi,
I have the same problem.
Have you any ideas?
Best regards
Fabio



fabio76 wrote:
 
 Thanks J.Pietschmann
 
 but I have another question.
 I have the following xml file:
 document
   pThis is a test/p
   table
   tr
   tdFirst TD/td
   tdSecond TD/td
   /tr
   /table
   figure
   titleFIGURE 1/title
   gGRAPHIC 1/g
   /figure
   pParagraph n° 1 after figure 1/p
   pParagraph n° 2 after figure 1/p
 pOther Text after figure 3

   figure
   titleFIGURE 2/title
   gGRAPHIC 2/g
   /figure
   pParagraph n° 1 after figure 2/p

   pParagraph n° 2 after figure 2/p
   /p
   pParagraph n° 3 uunderline tag/uafter figure 2/p
   fOther TAG/f
 p
   figure
   titleFIGURE 3/title
   gGRAPHIC 3/g
   /figureText after figure 3 
   pParagraph into onother Paragraph /p
   /p
 pLast paragraph/p
 /document
 
 
 With the help of J.Pietschmann I succeed to create figure in A3 page and
 other tag in A4 pagebut 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. puf 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=centerBLABLABLABLA/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=centerFIGURE/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()/
 

Re: Problem change layout page size

2007-01-09 Thread fabio76

Hi J.Pietschmann,
the example of xml document is this:
document
pThis is a test/p
table
tr
tdFirst TD/td
tdSecond TD/td
/tr
/table
figure
titleFIGURE 1/title
gGRAPHIC 1/g
/figure
pParagraph n° 1 after figure 1/p
pParagraph n° 2 after figure 1/p
pOther Text after figure 3
   
figure
titleFIGURE 2/title
gGRAPHIC 2/g
/figure
pParagraph n° 1 after figure 2/p
   
pParagraph n° 2 after figure 2/p
/p
pParagraph n° 3 uunderline tag/uafter figure 2/p
fOther TAG/f
p
figure
titleFIGURE 3/title
gGRAPHIC 3/g
/figureText after figure 3
pParagraph into onother Paragraph /p
/p
pLast paragraph/p
/document 


I think to use following and not following-sibling because the element
figure can be found in any position .. as in the preceding example.

If I use the preceding-sibling, I extract only the figure with the same
parent.

The result that I would like to obtain is this : 

1° node group in A4 layout page:
 pThis is a test/p
table
tr
tdFirst TD/td
tdSecond TD/td
/tr
/table

2° node group in A3 layout page:
figure
   titleFIGURE 1/title
gGRAPHIC 1/g
/figure

3° node group in A4 layout page:
pParagraph n° 1 after figure 1/p
pParagraph n° 2 after figure 1/p
pOther Text after figure 3

4° node group in A3 layout page:
figure
titleFIGURE 2/title
gGRAPHIC 2/g
/figure

5° node group in A4 layout page:
  pParagraph n° 1 after figure 2/p
pParagraph n° 2 after figure 2/p
/p
pParagraph n° 3 uunderline tag/uafter figure 2/p
fOther TAG/f
p

6° node group in A3 layout page:
figure
titleFIGURE 3/title
gGRAPHIC 3/g
/figure

7°  node group in A4 layout page:
Text after figure 3
pParagraph into onother Paragraph /p
/p
pLast paragraph/p



Is possible to obtain this? 

with best regards
Fabio




J.Pietschmann wrote:
 
 fabio76 wrote:
 I have a repetition of each paragraph ...and this is no correct.
 
 The problems are here:
 xsl:variable name=current-figure-node
 select=following::figure[1]/
 use
   xsl:variable name=current-figure-node select=./
 here and
xsl:apply-templates
 select=following::node()[generate-id(following::figure[1]) ...
  
 select=preceding-sibling::node()[generate-id(preceding-sibling::figure[1])
 
 The ..-sibling was the reason you got your content processed multiple
 times, and the following... was a bug.
 
 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#a8234323
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem change layout page size

2007-01-08 Thread fabio76

I have another question.
I have the same xml :
document
pThis is a test/p
table
tr
tdFirst TD/td
tdSecond TD/td
/tr
/table
figure
titleFIGURE 1/title
gGRAPHIC 1/g
/figure
pParagraph n° 1 after figure 1/p
pParagraph n° 2 after figure 1/p
pOther Text after figure 3
 
figure
titleFIGURE 2/title
gGRAPHIC 2/g
/figure
pParagraph n° 1 after figure 2/p
 
pParagraph n° 2 after figure 2/p
/p
pParagraph n° 3 uunderline tag/uafter figure 2/p
fOther TAG/f
p
figure
titleFIGURE 3/title
gGRAPHIC 3/g
/figureText after figure 3 
pParagraph into onother Paragraph /p
/p
pLast paragraph/p
/document


With the help of J.Pietschmann I succeed to create figure in A3 page and
other tag in A4 pagebut 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. puf 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=centerBLABLABLABLA/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=centerFIGURE/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 

Re: Problem change layout page size

2007-01-08 Thread fabio76

I have another question.
I have the same xml :
document
pThis is a test/p
table
tr
tdFirst TD/td
tdSecond TD/td
/tr
/table
figure
titleFIGURE 1/title
gGRAPHIC 1/g
/figure
pParagraph n° 1 after figure 1/p
pParagraph n° 2 after figure 1/p
pOther Text after figure 3
   
figure
titleFIGURE 2/title
gGRAPHIC 2/g
/figure
pParagraph n° 1 after figure 2/p
   
pParagraph n° 2 after figure 2/p
/p
pParagraph n° 3 uunderline tag/uafter figure 2/p
fOther TAG/f
p
figure
titleFIGURE 3/title
gGRAPHIC 3/g
/figureText after figure 3
pParagraph into onother Paragraph /p
/p
pLast paragraph/p
/document


With the help of J.Pietschmann I succeed to create figure in A3 page and
other tag in A4 pagebut 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. puf 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=centerBLABLABLABLA/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=centerFIGURE/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()/
   

Re: Problem change layout page size

2007-01-08 Thread J.Pietschmann

fabio76 wrote:

I have a repetition of each paragraph ...and this is no correct.


The problems are here:

xsl:variable name=current-figure-node
select=following::figure[1]/

use
 xsl:variable name=current-figure-node select=./
here and

   xsl:apply-templates
select=following::node()[generate-id(following::figure[1]) ...


select=preceding-sibling::node()[generate-id(preceding-sibling::figure[1])

The ..-sibling was the reason you got your content processed multiple
times, and the following... was a bug.

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem change layout page size

2007-01-05 Thread fabio76

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
  tdFirst TD/td
  tdSecond TD/td
  /tr
  /table
  figure
  titleFigure Title/title
  /figure
  pContinue 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#a8179849
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem change layout page size

2007-01-03 Thread J.Pietschmann

fabio76 wrote:

I have the following file xml :

document
pThis is a test/p
table
tr
tdFirst TD/td
tdSecond TD/td
/tr
/table
figure
titleFigure Title/title
/figure
pContinue 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]