Browse Source

First steps towards fo:retrieve-table-marker


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@652673 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Andreas L. Delmelle 16 years ago
parent
commit
1363d64956

+ 2
- 1
src/java/org/apache/fop/events/EventFormatter.xml View File

@@ -19,7 +19,8 @@
<catalogue xml:lang="en">
<message key="locator">[ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]</message>
<message key="rule.markerDescendantOfFlow">An fo:marker is permitted only as the descendant of an fo:flow.</message>
<message key="rule.retrieveMarkerDescendatOfStaticContent">An fo:retrieve-marker is permitted only as the descendant of an fo:static-content.</message>
<message key="rule.retrieveMarkerDescendantOfStaticContent">An fo:retrieve-marker is permitted only as the descendant of an fo:static-content.</message>
<message key="rule.retrieveTableMarkerDescendantOfHeaderOrFooter">An fo:retrieve-table-marker is permitted only as the descendant of an fo:table-header or an fo:table-footer.</message>
<message key="rule.bidiOverrideContent">An fo:bidi-override that is a descendant of an fo:leader or of the fo:inline child of an fo:footnote may not have block-level children, unless it has a nearer ancestor that is an fo:inline-container.</message>
<message key="rule.inlineContent">An fo:inline that is a descendant of an fo:leader or fo:footnote may not have block-level children, unless it has a nearer ancestor that is an fo:inline-container.</message>
<message key="rule.childOfSPM">The element must be a child of fo:simple-page-master.</message>

+ 19
- 3
src/java/org/apache/fop/fo/Constants.java View File

@@ -159,8 +159,10 @@ public interface Constants {
int FO_PAGE_SEQUENCE_WRAPPER = 60;
/** FO element constant - XSL 1.1 */
int FO_PAGE_NUMBER_CITATION_LAST = 61;
/** FO element constant - XSL 1.1 */
int FO_RETRIEVE_TABLE_MARKER = 62;
/** Number of FO element constants defined */
int FRM_OBJ_COUNT = 61;
int FRM_OBJ_COUNT = 62;

// Masks
/**
@@ -688,8 +690,12 @@ public interface Constants {
int PR_X_WIDOW_CONTENT_LIMIT = 252;
/** Property constant - FOP proprietary: limit for orphan content in lists and tables */
int PR_X_ORPHAN_CONTENT_LIMIT = 253;
/** Property constant */
int PR_RETRIEVE_POSITION_WITHIN_TABLE = 254;
/** Property constant */
int PR_RETRIEVE_BOUNDARY_WITHIN_TABLE = 255;
/** Number of property constants defined */
int PROPERTY_COUNT = 253;
int PROPERTY_COUNT = 255;

// compound property constants

@@ -1097,6 +1103,16 @@ public interface Constants {
int EN_REPLACE = 189;
/** Enumeration constant -- for fo:basic-link show-destination */
int EN_NEW = 190;
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_FIRST_STARTING = 191;
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_LAST_STARTING = 192;
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_LAST_ENDING = 193;
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_TABLE = 194;
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_TABLE_FRAGMENT = 195;
/** Number of enumeration constants defined */
int ENUM_COUNT = 190;
int ENUM_COUNT = 195;
}

+ 6
- 0
src/java/org/apache/fop/fo/FOElementMapping.java View File

@@ -135,6 +135,7 @@ public class FOElementMapping extends ElementMapping {
foObjs.put("wrapper", new WrapperMaker());
foObjs.put("marker", new MarkerMaker());
foObjs.put("retrieve-marker", new RetrieveMarkerMaker());
foObjs.put("retrieve-table-marker", new RetrieveTableMarkerMaker());
}
}

@@ -514,4 +515,9 @@ public class FOElementMapping extends ElementMapping {
}
}

static class RetrieveTableMarkerMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new org.apache.fop.fo.flow.RetrieveTableMarker(parent);
}
}
}

+ 19
- 0
src/java/org/apache/fop/fo/FOPropertyMapping.java View File

@@ -2097,6 +2097,25 @@ public final class FOPropertyMapping implements Constants {
m.addEnum("document", getEnumProperty(EN_DOCUMENT, "DOCUMENT"));
m.setDefault("page-sequence");
addPropertyMaker("retrieve-boundary", m);

// retrieve-position-within-table
m = new EnumProperty.Maker(PR_RETRIEVE_POSITION_WITHIN_TABLE);
m.setInherited(false);
m.addEnum("first-starting", getEnumProperty(EN_FIRST_STARTING, "FIRST_STARTING"));
m.addEnum("first-including-carryover", getEnumProperty(EN_FIC, "FIC"));
m.addEnum("last-starting", getEnumProperty(EN_LAST_STARTING, "LAST_STARTING"));
m.addEnum("last-ending", getEnumProperty(EN_LAST_ENDING, "LAST_ENDING"));
m.setDefault("first-starting");
addPropertyMaker("retrieve-position-within-table", m);

// retrieve-boundary-within-table
m = new EnumProperty.Maker(PR_RETRIEVE_BOUNDARY_WITHIN_TABLE);
m.setInherited(false);
m.addEnum("table", getEnumProperty(EN_TABLE, "TABLE"));
m.addEnum("table-fragment", getEnumProperty(EN_TABLE_FRAGMENT, "TABLE_FRAGMENT"));
m.addEnum("page", getEnumProperty(EN_DOCUMENT, "PAGE"));
m.setDefault("table");
addPropertyMaker("retrieve-boundary-within-table", m);
}

private void createNumberToStringProperties() {

+ 168
- 0
src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java View File

@@ -0,0 +1,168 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id:$ */
package org.apache.fop.fo.flow;

import org.apache.fop.fo.*;
import org.apache.fop.fo.flow.table.TableFObj;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.apps.FOPException;

import java.util.Iterator;

/**
* Abstract base class for the <a href="http://www.w3.org/TR/xsl/#fo_retrieve-marker">
* <code>fo:retrieve-marker</code></a> and
* <a href="http://www.w3.org/TR/xsl/#fo_retrieve-table-marker">
* <code>fo:retrieve-table-marker</code></a> formatting objects.

*/
public abstract class AbstractRetrieveMarker extends FObjMixed {

private PropertyList propertyList;

/**
* Create a new AbstractRetrieveMarker instance that
* is a child of the given {@link FONode}
*
* @param parent the parent {@link FONode}
*/
public AbstractRetrieveMarker(FONode parent) {
super(parent);
}

/**
* {@inheritDoc}
* Store a reference to the parent {@link PropertyList}
* to be used when the retrieve-marker is resolved.
*/
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
this.propertyList = pList.getParentPropertyList();
}

private PropertyList createPropertyListFor(FObj fo, PropertyList parent) {
return getFOEventHandler().getPropertyListMaker().make(fo, parent);
}

private void cloneSingleNode(FONode child, FONode newParent,
Marker marker, PropertyList parentPropertyList)
throws FOPException {

if (child != null) {
FONode newChild = child.clone(newParent, true);
if (child instanceof FObj) {
Marker.MarkerPropertyList pList;
PropertyList newPropertyList = createPropertyListFor(
(FObj) newChild, parentPropertyList);

pList = marker.getPropertyListFor(child);
newChild.processNode(
child.getLocalName(),
getLocator(),
pList,
newPropertyList);
if (newChild instanceof TableFObj) {
// TODO calling startOfNode (and endOfNode, below) on other fobjs may
// have undesirable side-effects. This is really ugly and will need to
// be addressed sooner or later
((TableFObj) newChild).startOfNode();
}
addChildTo(newChild, (FObj) newParent);
if (newChild.getNameId() == FO_TABLE) {
Table t = (Table) child;
cloneSubtree(t.getColumns().listIterator(),
newChild, marker, newPropertyList);
cloneSingleNode(t.getTableHeader(),
newChild, marker, newPropertyList);
cloneSingleNode(t.getTableFooter(),
newChild, marker, newPropertyList);
}
cloneSubtree(child.getChildNodes(), newChild,
marker, newPropertyList);
if (newChild instanceof TableFObj) {
// TODO this is ugly
((TableFObj) newChild).endOfNode();
}
} else if (child instanceof FOText) {
FOText ft = (FOText) newChild;
ft.bind(parentPropertyList);
addChildTo(newChild, (FObj) newParent);
}
if (newChild instanceof FObjMixed) {
handleWhiteSpaceFor((FObjMixed) newChild);
}
}
}

/**
* Clone the FO nodes in the parent iterator,
* attach the new nodes to the new parent,
* and map the new nodes to the existing property lists.
* FOText nodes are also in the new map, with a null value.
* Clone the subtree by a recursive call to this method.
* @param parentIter the iterator over the children of the old parent
* @param newParent the new parent for the cloned nodes
* @param marker the marker that contains the old property list mapping
* @param parentPropertyList the parent PropertyList
* @throws FOPException in case there was an error
*/
private void cloneSubtree(Iterator parentIter, FONode newParent,
Marker marker, PropertyList parentPropertyList)
throws FOPException {
if (parentIter != null) {
FONode child;
while (parentIter.hasNext()) {
child = (FONode) parentIter.next();
cloneSingleNode(child, newParent,
marker, parentPropertyList);
}
}
}

private void cloneFromMarker(Marker marker)
throws FOPException {
// clean up remnants from a possible earlier layout
if (firstChild != null) {
currentTextNode = null;
firstChild = null;
}
cloneSubtree(marker.getChildNodes(), this,
marker, propertyList);
handleWhiteSpaceFor(this);
}

/**
* Clone the subtree of the given marker
*
* @param marker the marker that is to be cloned
*/
public void bindMarker(Marker marker) {
if (marker.getChildNodes() != null) {
try {
cloneFromMarker(marker);
} catch (FOPException exc) {
getFOValidationEventProducer().markerCloningFailed(this,
marker.getMarkerClassName(), exc, getLocator());
}
} else if (log.isDebugEnabled()) {
log.debug("Empty marker retrieved...");
}
}

}

+ 22
- 123
src/java/org/apache/fop/fo/flow/RetrieveMarker.java View File

@@ -23,29 +23,25 @@ import java.util.Iterator;

import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableFObj;
import org.xml.sax.Locator;
import org.xml.sax.Attributes;

/**
* Class modelling the fo:retrieve-marker object.
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_retrieve-marker">
* <code>fo:retrieve-marker</code></a> formatting object.
* This will create a layout manager that will retrieve
* a marker based on the information.
*/
public class RetrieveMarker extends FObjMixed {
public class RetrieveMarker extends AbstractRetrieveMarker {

// The value of properties relevant for fo:retrieve-marker.
private String retrieveClassName;
private int retrievePosition;
private int retrieveBoundary;
// End of property values

private PropertyList propertyList;

/**
* Create a new RetrieveMarker instance that is a
* child of the given {@link FONode}.
@@ -56,12 +52,26 @@ public class RetrieveMarker extends FObjMixed {
super(parent);
}

/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
/**
* {@inheritDoc}
* <i>NOTE: An <code>fo:retrieve-marker</code> is only permitted as a descendant
* of an <code>fo:static-content</code>.</i>
*/
public void processNode(String elementName,
Locator locator,
Attributes attlist,
PropertyList pList)
throws FOPException {
if (findAncestor(FO_STATIC_CONTENT) < 0) {
invalidChildError(locator, getParent().getName(), FO_URI, getName(),
"rule.retrieveMarkerDescendatOfStaticContent");
"rule.retrieveMarkerDescendantOfStaticContent");
} else {
super.processNode(elementName, locator, attlist, pList);
}
}

/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {

retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString();
retrievePosition = pList.get(PR_RETRIEVE_POSITION).getEnum();
@@ -70,8 +80,6 @@ public class RetrieveMarker extends FObjMixed {
if (retrieveClassName == null || retrieveClassName.equals("")) {
missingPropertyError("retrieve-class-name");
}

propertyList = pList.getParentPropertyList();
super.bind(pList);
}

@@ -107,115 +115,6 @@ public class RetrieveMarker extends FObjMixed {
return retrieveBoundary;
}

private PropertyList createPropertyListFor(FObj fo, PropertyList parent) {
return getFOEventHandler().getPropertyListMaker().make(fo, parent);
}

private void cloneSingleNode(FONode child, FONode newParent,
Marker marker, PropertyList parentPropertyList)
throws FOPException {

if (child != null) {
FONode newChild = child.clone(newParent, true);
if (child instanceof FObj) {
Marker.MarkerPropertyList pList;
PropertyList newPropertyList = createPropertyListFor(
(FObj) newChild, parentPropertyList);

pList = marker.getPropertyListFor(child);
newChild.processNode(
child.getLocalName(),
getLocator(),
pList,
newPropertyList);
if (newChild instanceof TableFObj) {
// TODO calling startOfNode (and endOfNode, below) on other fobjs may
// have undesirable side-effects. This is really ugly and will need to
// be addressed sooner or later
((TableFObj) newChild).startOfNode();
}
addChildTo(newChild, (FObj) newParent);
if (newChild.getNameId() == FO_TABLE) {
Table t = (Table) child;
cloneSubtree(t.getColumns().listIterator(),
newChild, marker, newPropertyList);
cloneSingleNode(t.getTableHeader(),
newChild, marker, newPropertyList);
cloneSingleNode(t.getTableFooter(),
newChild, marker, newPropertyList);
}
cloneSubtree(child.getChildNodes(), newChild,
marker, newPropertyList);
if (newChild instanceof TableFObj) {
// TODO this is ugly
((TableFObj) newChild).endOfNode();
}
} else if (child instanceof FOText) {
FOText ft = (FOText) newChild;
ft.bind(parentPropertyList);
addChildTo(newChild, (FObj) newParent);
}
if (newChild instanceof FObjMixed) {
handleWhiteSpaceFor((FObjMixed) newChild);
}
}
}

/**
* Clone the FO nodes in the parent iterator,
* attach the new nodes to the new parent,
* and map the new nodes to the existing property lists.
* FOText nodes are also in the new map, with a null value.
* Clone the subtree by a recursive call to this method.
* @param parentIter the iterator over the children of the old parent
* @param newParent the new parent for the cloned nodes
* @param marker the marker that contains the old property list mapping
* @param descPLists the map of the new nodes to property lists
*/
private void cloneSubtree(Iterator parentIter, FONode newParent,
Marker marker, PropertyList parentPropertyList)
throws FOPException {
if (parentIter != null) {
FONode child;
while (parentIter.hasNext()) {
child = (FONode) parentIter.next();
cloneSingleNode(child, newParent,
marker, parentPropertyList);
}
}
}

private void cloneFromMarker(Marker marker)
throws FOPException {
// clean up remnants from a possible earlier layout
if (firstChild != null) {
currentTextNode = null;
firstChild = null;
}
cloneSubtree(marker.getChildNodes(), this,
marker, propertyList);
handleWhiteSpaceFor(this);
}

/**
* Clone the subtree of the given marker
*
* @param marker the marker that is to be cloned
*/
public void bindMarker(Marker marker) {
if (marker.getChildNodes() != null) {
try {
cloneFromMarker(marker);
} catch (FOPException exc) {
getFOValidationEventProducer().markerCloningFailed(this,
marker.getMarkerClassName(), exc, getLocator());
return;
}
} else if (log.isDebugEnabled()) {
log.debug("Empty marker retrieved...");
}
}

/** {@inheritDoc} */
public String getLocalName() {
return "retrieve-marker";

+ 111
- 0
src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java View File

@@ -0,0 +1,111 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id:$ */
package org.apache.fop.fo.flow;

import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.apps.FOPException;
import org.xml.sax.Locator;
import org.xml.sax.Attributes;

/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_retrieve-table-marker">
* <code>fo:retrieve-table-marker</code></a> formatting object.
*/
public class RetrieveTableMarker extends AbstractRetrieveMarker {

// The value of properties relevant for fo:retrieve-marker.
private String retrieveClassName;
private int retrievePositionWithinTable;
private int retrieveBoundaryWithinTable;
// end property values

/**
* Create a new RetrieveTableMarker instance that is
* a child of the given {@link FONode}.
*
* @param parent the parent {@link FONode}
*/
public RetrieveTableMarker(FONode parent) {
super(parent);
}

/** {@inheritDoc} */
public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException {
if (findAncestor(FO_TABLE_HEADER) < 0
&& findAncestor(FO_TABLE_FOOTER) < 0) {
invalidChildError(locator, getParent().getName(), FO_URI, getName(),
"rule.retrieveTableMarkerDescendantOfHeaderOrFooter");
} else {
super.processNode(elementName, locator, attlist, pList);
}
}

/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
this.retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString();
this.retrievePositionWithinTable
= pList.get(PR_RETRIEVE_POSITION_WITHIN_TABLE).getEnum();
this.retrieveBoundaryWithinTable
= pList.get(PR_RETRIEVE_BOUNDARY_WITHIN_TABLE).getEnum();
}

/** {@inheritDoc} */
public String getRetrieveClassName() {
return this.retrieveClassName;
}

/**
* Return the value for the <code>retrieve-position-within-table</code>
* property
* @return the value for retrieve-position-within-table; one of
* {@link org.apache.fop.fo.Constants#EN_FIRST_STARTING},
* {@link org.apache.fop.fo.Constants#EN_FIC},
* {@link org.apache.fop.fo.Constants#EN_LAST_STARTING},
* {@link org.apache.fop.fo.Constants#EN_LAST_ENDING}.
*/
public int getRetrievePositionWithinTable() {
return this.retrievePositionWithinTable;
}

/**
* Return the value for the <code>retrieve-boundary-within-table</code>
* property
* @return the value for retrieve-boundary-within-table; one of
* {@link org.apache.fop.fo.Constants#EN_TABLE},
* {@link org.apache.fop.fo.Constants#EN_TABLE_FRAGMENT},
* {@link org.apache.fop.fo.Constants#EN_PAGE}.
*/
public int getRetrieveBoundaryWithinTable() {
return this.retrieveBoundaryWithinTable;
}

/** {@inheritDoc} */
public String getLocalName() {
return "retrieve-table-marker";
}

/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_RETRIEVE_TABLE_MARKER}
*/
public int getNameId() {
return FO_RETRIEVE_TABLE_MARKER;
}
}

+ 3
- 16
src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java View File

@@ -51,6 +51,7 @@ import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.PageNumberCitationLast;
import org.apache.fop.fo.flow.RetrieveMarker;
import org.apache.fop.fo.flow.RetrieveTableMarker;
import org.apache.fop.fo.flow.Wrapper;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
@@ -117,6 +118,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
makers.put(Block.class, new BlockLayoutManagerMaker());
makers.put(Leader.class, new LeaderLayoutManagerMaker());
makers.put(RetrieveMarker.class, new RetrieveMarkerLayoutManagerMaker());
makers.put(RetrieveTableMarker.class, new Maker());
makers.put(Character.class, new CharacterLayoutManagerMaker());
makers.put(ExternalGraphic.class,
new ExternalGraphicLayoutManagerMaker());
@@ -207,9 +209,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
return new StaticContentLayoutManager(pslm, sc, reg);
}
/*
* {@inheritDoc}
*/
/** {@inheritDoc} */
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, org.apache.fop.area.Block block) {
return new StaticContentLayoutManager(pslm, sc, block);
@@ -218,7 +218,6 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
public static class Maker {
public void make(FONode node, List lms) {
// no layout manager
return;
}
}

@@ -231,18 +230,6 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
}

/*
public static class FObjMixedLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
if (node.getChildNodes() != null) {
InlineStackingLayoutManager lm;
lm = new InlineStackingLayoutManager((FObjMixed) node);
lms.add(lm);
}
}
}
*/

public static class BidiOverrideLayoutManagerMaker extends Maker {
// public static class BidiOverrideLayoutManagerMaker extends FObjMixedLayoutManagerMaker {
public void make(BidiOverride node, List lms) {

+ 68
- 0
test/fotree/testcases/table_retrieve-table-marker.fo View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- This test checks the processing of the initial values for properties on
fo:table-retrieve-marker -->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:test="http://xmlgraphics.apache.org/fop/test">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" border-collapse="separate" border-spacing="5pt 2pt">
<test:assert property="border-separation.inline-progression-direction" expected="5000mpt"/>
<test:assert property="border-separation.block-progression-direction" expected="2000mpt"/>
<fo:table-column column-width="160pt"/>
<fo:table-column column-width="160pt"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
<fo:block>
<fo:retrieve-table-marker marker-class-name="mc1">
<test:assert property="marker-class-name" expected="mc1" />
<test:assert property="retrieve-position-within-table" expected="FIRST_STARTING" />
<test:assert property="retrieve-boundary-within-table" expected="TABLE" />
</fo:retrieve-table-marker>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>cell1</fo:block>
</fo:table-cell>
<fo:table-cell border="solid 5pt black">
<fo:block>cell2</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="solid 5pt">
<fo:block>cell3</fo:block>
</fo:table-cell>
<fo:table-cell height="20pt" border="solid 10pt red">
<fo:block>cell4</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>

Loading…
Cancel
Save