This project is read-only.

margin gets ignored

Mar 7, 2014 at 9:57 AM
hello.

i have written the following little fo-file but the output is not what i expected. i have tested it with apache fop and everything is just fine, so i think there is either an error in fo.net or something is wrong im my fo. can you give me a hint? thanks in advance...

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="right-page" page-height="297mm" page-width="210mm" margin="20mm 25mm 30mm 15mm">
  <fo:region-body margin="25mm 0mm 30mm 0mm"/>
  <fo:region-before region-name="right-header" extent="15mm"/>
  <fo:region-after region-name="right-footer" extent="20mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="left-page" page-height="297mm" page-width="210mm" margin="20mm 25mm 30mm 15mm">
  <fo:region-body margin="25mm 0mm 30mm 0mm"/>
  <fo:region-before region-name="left-header" extent="15mm"/>
  <fo:region-after region-name="left-footer" extent="20mm"/>      
</fo:simple-page-master>

<fo:page-sequence-master master-name="right-left-sequence">
  <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference master-reference="right-page" odd-or-even="odd"/>
    <fo:conditional-page-master-reference master-reference="left-page" odd-or-even="even"/>
  </fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="right-left-sequence">
<fo:static-content flow-name="right-header">
  <fo:block>... header of right page ...</fo:block>
</fo:static-content>
<fo:static-content flow-name="right-footer">
  <fo:block>... footer of right page ...</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
  <fo:block>... body ...</fo:block>
</fo:flow>
</fo:page-sequence>

<fo:page-sequence master-reference="right-left-sequence">
<fo:static-content flow-name="left-header">
  <fo:block>... header of left page ...</fo:block>
</fo:static-content>
<fo:static-content flow-name="left-footer">
  <fo:block>... footer of left page ...</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
  <fo:block>... body ...</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>

best regards, hurby.
Mar 10, 2014 at 11:22 AM
okay, i got it.

the margin-property is not specified in XSL version 1.0. so you have to use margin-top margin-right margin-bottom and margin-left.

best regards, hurby.
Marked as answer by Hurby on 3/10/2014 at 3:22 AM