aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'test/java/org/apache')
-rw-r--r--test/java/org/apache/fop/accessibility/fo/DOMResultUtil.java54
-rw-r--r--test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java (renamed from test/java/org/apache/fop/accessibility/FO2StructureTreeConverterTestCase.java)109
-rw-r--r--test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl (renamed from test/java/org/apache/fop/accessibility/fo2StructureTree.xsl)23
-rw-r--r--test/java/org/apache/fop/accessibility/fo/table-footers.fo195
-rw-r--r--test/java/org/apache/fop/accessibility/fo/wrapCompleteDocumentInTableFooter.xsl66
-rw-r--r--test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java2
6 files changed, 402 insertions, 47 deletions
diff --git a/test/java/org/apache/fop/accessibility/fo/DOMResultUtil.java b/test/java/org/apache/fop/accessibility/fo/DOMResultUtil.java
new file mode 100644
index 000000000..5b4e264f2
--- /dev/null
+++ b/test/java/org/apache/fop/accessibility/fo/DOMResultUtil.java
@@ -0,0 +1,54 @@
+/*
+ * 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.accessibility.fo;
+
+import java.io.File;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+/**
+ * Utility class to stream an instance of {@link DOMResult} into a file. May be
+ * useful for debugging.
+ */
+final class DOMResultUtil {
+
+ private DOMResultUtil() {
+ }
+
+ /**
+ * Streams the given result into a file of the given name.
+ *
+ * @param result the result of a transformation
+ * @param filename name of the file into which to stream the result
+ * @throws TransformerException if a problem occurs when streaming
+ */
+ public static void streamToFile(DOMResult result, String filename) throws TransformerException {
+ DOMSource source = new DOMSource(result.getNode());
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ transformer.transform(source, new StreamResult(new File(filename)));
+ }
+
+}
diff --git a/test/java/org/apache/fop/accessibility/FO2StructureTreeConverterTestCase.java b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
index f8719edd6..9c53bdde3 100644
--- a/test/java/org/apache/fop/accessibility/FO2StructureTreeConverterTestCase.java
+++ b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java
@@ -17,10 +17,12 @@
/* $Id$ */
-package org.apache.fop.accessibility;
+package org.apache.fop.accessibility.fo;
import static org.junit.Assert.assertTrue;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -34,18 +36,17 @@ import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.Difference;
-import org.custommonkey.xmlunit.DifferenceConstants;
-import org.custommonkey.xmlunit.DifferenceListener;
import org.junit.Test;
import org.w3c.dom.Document;
-import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
+import org.apache.fop.accessibility.StructureTree2SAXEventAdapter;
+import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FODocumentParser;
@@ -56,54 +57,75 @@ import org.apache.fop.fotreetest.DummyFOEventHandler;
public class FO2StructureTreeConverterTestCase {
- private static class IgnoringPtrDifferenceListener implements DifferenceListener {
-
- public int differenceFound(Difference difference) {
- switch (difference.getId()) {
- case DifferenceConstants.ELEMENT_NUM_ATTRIBUTES_ID:
- return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
- case DifferenceConstants.ATTR_NAME_NOT_FOUND_ID:
- String additionalAttribute = difference.getTestNodeDetail().getValue();
- if (additionalAttribute.equals("ptr")) {
- return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
- } else {
- return RETURN_ACCEPT_DIFFERENCE;
- }
- default:
- return RETURN_ACCEPT_DIFFERENCE;
- }
- }
+ private interface FOLoader {
- public void skippedComparison(Node control, Node test) {
- throw new UnsupportedOperationException("Not implemented");
- }
+ InputStream getFoInputStream();
}
private static final String STRUCTURE_TREE_SEQUENCE_NAME = "structure-tree-sequence";
+ private FOLoader foLoader;
+
+ @Test
+ public void testCompleteDocument() throws Exception {
+ foLoader = new FOLoader() {
+ public InputStream getFoInputStream() {
+ return getResource("/org/apache/fop/fo/complete_document.fo");
+ }
+ };
+ testConverter();
+ }
+
+ @Test
+ public void testTableFooters() throws Exception {
+ foLoader = new FOLoader() {
+ public InputStream getFoInputStream() {
+ return getResource("table-footers.fo");
+ }
+ };
+ testConverter();
+ }
+
@Test
- public void testConverter() throws Exception {
+ public void testCompleteContentWrappedInTableFooter() throws Exception {
+ Source xslt = new StreamSource(getResource("wrapCompleteDocumentInTableFooter.xsl"));
+ Transformer transformer = createTransformer(xslt);
+ InputStream originalFO = getResource("/org/apache/fop/fo/complete_document.fo");
+ ByteArrayOutputStream transformedFoOutput = new ByteArrayOutputStream();
+ transformer.transform(new StreamSource(originalFO), new StreamResult(transformedFoOutput));
+ final byte[] transformedFoOutputBytes = transformedFoOutput.toByteArray();
+ foLoader = new FOLoader() {
+ public InputStream getFoInputStream() {
+ return new ByteArrayInputStream(transformedFoOutputBytes);
+ }
+ };
+ testConverter();
+ }
+
+ private Transformer createTransformer(Source xslt) throws TransformerFactoryConfigurationError,
+ TransformerConfigurationException {
+ TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ return transformerFactory.newTransformer(xslt);
+ }
+
+ private static InputStream getResource(String name) {
+ return FO2StructureTreeConverterTestCase.class.getResourceAsStream(name);
+ }
+
+ private void testConverter() throws Exception {
DOMResult expectedStructureTree = loadExpectedStructureTree();
DOMResult actualStructureTree = buildActualStructureTree();
final Diff diff = createDiff(expectedStructureTree, actualStructureTree);
- assertTrue(diff.toString(), diff.similar());
+ assertTrue(diff.toString(), diff.identical());
}
- private static DOMResult loadExpectedStructureTree() {
+ private DOMResult loadExpectedStructureTree() {
DOMResult expectedStructureTree = new DOMResult();
- runXSLT(getXsltInputStream(), getFoInputStream(), expectedStructureTree);
+ InputStream xslt = getResource("fo2StructureTree.xsl");
+ runXSLT(xslt, foLoader.getFoInputStream(), expectedStructureTree);
return expectedStructureTree;
}
- private static InputStream getXsltInputStream() {
- return FO2StructureTreeConverterTestCase.class.getResourceAsStream("foToIfStructureTree.xsl");
- }
-
- private static InputStream getFoInputStream() {
- return FO2StructureTreeConverterTestCase.class.getResourceAsStream(
- "/org/apache/fop/fo/complete_document.fo");
- }
-
private static void runXSLT(InputStream xslt, InputStream doc, Result result) {
Source fo = new StreamSource(doc);
try {
@@ -128,15 +150,15 @@ public class FO2StructureTreeConverterTestCase {
}
}
- private static DOMResult buildActualStructureTree() throws Exception {
+ private DOMResult buildActualStructureTree() throws Exception {
DOMResult actualStructureTree = new DOMResult();
- createStructureTreeFromDocument(getFoInputStream(), actualStructureTree);
+ createStructureTreeFromDocument(foLoader.getFoInputStream(), actualStructureTree);
return actualStructureTree;
}
private static void createStructureTreeFromDocument(InputStream foInputStream,
- DOMResult domResult) throws Exception {
- TransformerHandler tHandler = createTransformerHandler(domResult);
+ Result result) throws Exception {
+ TransformerHandler tHandler = createTransformerHandler(result);
startStructureTreeSequence(tHandler);
StructureTreeEventHandler structureTreeEventHandler
= StructureTree2SAXEventAdapter.newInstance(tHandler);
@@ -146,7 +168,7 @@ public class FO2StructureTreeConverterTestCase {
endStructureTreeSequence(tHandler);
}
- private static TransformerHandler createTransformerHandler(DOMResult domResult)
+ private static TransformerHandler createTransformerHandler(Result domResult)
throws TransformerConfigurationException, TransformerFactoryConfigurationError {
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
TransformerHandler transformerHandler = factory.newTransformerHandler();
@@ -192,7 +214,6 @@ public class FO2StructureTreeConverterTestCase {
private static Diff createDiff(DOMResult expected, DOMResult actual) {
Diff diff = new Diff(getDocument(expected), getDocument(actual));
- diff.overrideDifferenceListener(new IgnoringPtrDifferenceListener());
return diff;
}
diff --git a/test/java/org/apache/fop/accessibility/fo2StructureTree.xsl b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
index 5c9c5615c..ce326f3b1 100644
--- a/test/java/org/apache/fop/accessibility/fo2StructureTree.xsl
+++ b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl
@@ -69,10 +69,18 @@
</xsl:template>
<!-- Formatting Objects for Tables -->
- <xsl:template match="fo:table-and-caption|fo:table-caption|fo:table">
+ <xsl:template match="fo:table-and-caption|fo:table-caption">
<xsl:call-template name="copy"/>
</xsl:template>
+ <xsl:template match="fo:table">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="*[name() != 'fo:table-footer']"/>
+ <xsl:apply-templates select="fo:table-footer"/>
+ </xsl:copy>
+ </xsl:template>
+
<xsl:template match="fo:table-header|fo:table-footer|fo:table-body|fo:table-row|fo:table-cell">
<xsl:call-template name="copy"/>
</xsl:template>
@@ -110,7 +118,18 @@
<xsl:template match="@*"/>
- <!-- Discard text -->
+ <!-- Discard text nodes... -->
<xsl:template match="text()"/>
+ <!-- ...except those that will result into marked content -->
+ <xsl:template match="fo:title/text()
+ |fo:block/text()
+ |fo:bidi-override/text()
+ |fo:inline/text()
+ |fo:basic-link/text()
+ |fo:wrapper/text()
+ |fo:marker/text()">
+ <marked-content xmlns="http://xmlgraphics.apache.org/fop/intermediate"/>
+ </xsl:template>
+
</xsl:stylesheet>
diff --git a/test/java/org/apache/fop/accessibility/fo/table-footers.fo b/test/java/org/apache/fop/accessibility/fo/table-footers.fo
new file mode 100644
index 000000000..6dcb9b68d
--- /dev/null
+++ b/test/java/org/apache/fop/accessibility/fo/table-footers.fo
@@ -0,0 +1,195 @@
+<?xml version="1.0" standalone="no"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="440pt" page-width="420pt" margin="10pt">
+ <fo:region-body display-align="center"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body" line-height="10pt" font-size="8pt">
+ <fo:table width="100% - 6pt" table-layout="fixed"
+ border-collapse="separate" border="2pt solid black" border-separation="2pt" padding="1pt"
+ start-indent="3pt" end-indent="3pt" space-after="2pt">
+ <fo:table-header start-indent="0" end-indent="0">
+ <fo:table-cell background-color="#E0E0E0" padding="2pt">
+ <fo:block>Start Outer Header</fo:block>
+ <fo:table width="100% - 6pt" table-layout="fixed"
+ border="2pt solid red" padding="1pt"
+ start-indent="3pt" end-indent="3pt" space-after="2pt">
+ <fo:table-header start-indent="0" end-indent="0">
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer start-indent="0" end-indent="0">
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Footer 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Footer 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body start-indent="0" end-indent="0">
+ <fo:table-row>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Body 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Body 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Body 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="#FFB0B0" padding="2pt">
+ <fo:block>Inner Body 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:block>End Outer Header</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer start-indent="0" end-indent="0">
+ <fo:table-cell background-color="#E0E0E0" padding="2pt">
+ <fo:block>Start Outer Footer</fo:block>
+ <fo:table width="100% - 6pt" table-layout="fixed"
+ border="2pt solid green" padding="1pt"
+ start-indent="3pt" end-indent="3pt" space-after="2pt">
+ <fo:table-header start-indent="0" end-indent="0">
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer start-indent="0" end-indent="0">
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Start Inner Footer 1.1</fo:block>
+ <fo:table width="100% - 6pt" table-layout="fixed"
+ border="2pt solid yellow" padding="1pt"
+ start-indent="3pt" end-indent="3pt" space-after="2pt">
+ <fo:table-header start-indent="0" end-indent="0">
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer start-indent="0" end-indent="0">
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Footer 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Footer 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body start-indent="0" end-indent="0">
+ <fo:table-row>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Body 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Body 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Body 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="yellow" padding="2pt">
+ <fo:block>Inner Inner Body 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:block>End Inner Footer 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Footer 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body start-indent="0" end-indent="0">
+ <fo:table-row>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Body 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Body 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Body 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightgreen" padding="2pt">
+ <fo:block>Inner Body 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:block>End Outer Footer</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body start-indent="0" end-indent="0">
+ <fo:table-row>
+ <fo:table-cell background-color="#E0E0E0" padding="2pt">
+ <fo:block>Outer Body Cell 1</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell background-color="#E0E0E0" padding="2pt">
+ <fo:block>Start Outer Body Cell 2</fo:block>
+ <fo:table width="100% - 6pt" table-layout="fixed"
+ border="2pt solid blue" padding="1pt"
+ start-indent="3pt" end-indent="3pt" space-after="2pt">
+ <fo:table-header start-indent="0" end-indent="0">
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Footer 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Footer 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer start-indent="0" end-indent="0">
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Header 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Header 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body start-indent="0" end-indent="0">
+ <fo:table-row>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Body 1.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Body 1.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Body 2.1</fo:block>
+ </fo:table-cell>
+ <fo:table-cell background-color="lightblue" padding="2pt">
+ <fo:block>Inner Body 2.2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:block>End Outer Body Cell 2</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
diff --git a/test/java/org/apache/fop/accessibility/fo/wrapCompleteDocumentInTableFooter.xsl b/test/java/org/apache/fop/accessibility/fo/wrapCompleteDocumentInTableFooter.xsl
new file mode 100644
index 000000000..9608b2fb9
--- /dev/null
+++ b/test/java/org/apache/fop/accessibility/fo/wrapCompleteDocumentInTableFooter.xsl
@@ -0,0 +1,66 @@
+<?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$ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <xsl:template match="@*|node()" name="copy">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+
+ <xsl:template match="/">
+ <fo:root>
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="500pt" page-width="300pt" margin="20pt">
+ <fo:region-body margin-top="20pt"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <xsl:apply-templates select="//fo:page-sequence"/>
+ </fo:root>
+ </xsl:template>
+
+ <xsl:template match="fo:page-sequence">
+ <fo:page-sequence master-reference="page">
+ <xsl:apply-templates select="fo:flow"/>
+ </fo:page-sequence>
+ </xsl:template>
+
+ <xsl:template match="fo:flow">
+ <xsl:copy>
+ <xsl:apply-templates select="@*[not(starts-with(name(), 'space-before'))]"/>
+ <fo:table width="100%" table-layout="fixed">
+ <fo:table-footer>
+ <fo:table-cell background-color="#F0F0F0">
+ <xsl:apply-templates select="@*[starts-with(name(), 'space-before')]"/>
+ <xsl:apply-templates select="*"/>
+ </fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body>
+ <fo:table-cell>
+ <fo:block>The content below is in the table footer.</fo:block>
+ </fo:table-cell>
+ </fo:table-body>
+ </fo:table>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java b/test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java
index d7db7db7f..65c6b25a6 100644
--- a/test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java
+++ b/test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java
@@ -85,7 +85,7 @@ public class IFStructureTreeBuilderTestCase {
@Test
public void startNode() throws Exception {
- final String[] attributes = {"ptr", "1"};
+ final String[] attributes = {"struct-id", "1"};
final String nodeName = "block";
final ContentHandler handler = mock(ContentHandler.class);