xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r728737 - in /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign: src/java/org/apache/fop/render/intermediate/ src/java/org/apache/fop/render/ps/ test/layoutengine/standard-testcases/
Date Mon, 22 Dec 2008 18:23:03 GMT
Author: jeremias
Date: Mon Dec 22 10:23:03 2008
New Revision: 728737

URL: http://svn.apache.org/viewvc?rev=728737&view=rev
Log:
Most of the PostScript extensions are implemented in PSPainter now (and tested).
Bugfix: IFSerializer wrote out the page name instead of the page-master-name for the page-master-name
attribute.

Modified:
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFRenderer.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFSerializer.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_1.xml
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_2.xml

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFRenderer.java?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFRenderer.java
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFRenderer.java
Mon Dec 22 10:23:03 2008
@@ -308,6 +308,12 @@
             ExtensionAttachment attachment = ((OffDocumentExtensionAttachment)odi).getAttachment();
             if (XMPMetadata.CATEGORY.equals(attachment.getCategory())) {
                 renderXMPMetadata((XMPMetadata)attachment);
+            } else {
+                try {
+                    this.documentHandler.handleExtensionObject(attachment);
+                } catch (IFException ife) {
+                    handleIFException(ife);
+                }
             }
         }
     }
@@ -551,7 +557,16 @@
             documentHandler.startPage(page.getPageIndex(), page.getPageNumberString(),
                     page.getSimplePageMasterName(), dim);
             documentHandler.startPageHeader();
-            //TODO Handle page header
+
+            //Add page attachments to page header
+            if (page.hasExtensionAttachments()) {
+                for (Iterator iter = page.getExtensionAttachments().iterator();
+                    iter.hasNext();) {
+                    ExtensionAttachment attachment = (ExtensionAttachment) iter.next();
+                    this.documentHandler.handleExtensionObject(attachment);
+                }
+            }
+
             documentHandler.endPageHeader();
             this.painter = documentHandler.startPageContent();
             super.renderPage(page);

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFSerializer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFSerializer.java?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFSerializer.java
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/intermediate/IFSerializer.java
Mon Dec 22 10:23:03 2008
@@ -226,7 +226,7 @@
             AttributesImpl atts = new AttributesImpl();
             addAttribute(atts, "index", Integer.toString(index));
             addAttribute(atts, "name", name);
-            addAttribute(atts, "page-master-name", name);
+            addAttribute(atts, "page-master-name", pageMasterName);
             addAttribute(atts, "width", Integer.toString(size.width));
             addAttribute(atts, "height", Integer.toString(size.height));
             handler.startElement(EL_PAGE, atts);

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSDocumentHandler.java?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
Mon Dec 22 10:23:03 2008
@@ -20,13 +20,13 @@
 package org.apache.fop.render.ps;
 
 import java.awt.Dimension;
+import java.awt.geom.Dimension2D;
 import java.awt.geom.Rectangle2D;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -36,7 +36,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.xmlgraphics.java2d.Dimension2DDouble;
 import org.apache.xmlgraphics.ps.DSCConstants;
+import org.apache.xmlgraphics.ps.PSDictionary;
+import org.apache.xmlgraphics.ps.PSDictionaryFormatException;
 import org.apache.xmlgraphics.ps.PSGenerator;
 import org.apache.xmlgraphics.ps.PSPageDeviceDictionary;
 import org.apache.xmlgraphics.ps.PSProcSets;
@@ -54,8 +57,10 @@
 import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFPainter;
-import org.apache.fop.render.ps.extensions.PSExtensionAttachment;
+import org.apache.fop.render.ps.extensions.PSCommentAfter;
+import org.apache.fop.render.ps.extensions.PSCommentBefore;
 import org.apache.fop.render.ps.extensions.PSSetPageDevice;
+import org.apache.fop.render.ps.extensions.PSSetupCode;
 
 /**
  * {@code IFDocumentHandler} implementation that produces PostScript.
@@ -78,6 +83,7 @@
     private File tempFile;
 
     private int currentPageNumber = 0;
+    private PageDefinition currentPageDefinition;
 
     /** Is used to determine the document's bounding box */
     private Rectangle2D documentBoundingBox;
@@ -94,10 +100,10 @@
     private PSPageDeviceDictionary pageDeviceDictionary;
 
     /** This is a collection holding all document header comments */
-    private Collection headerComments;
-
-    /** This is a collection holding all document footer comments */
-    private Collection footerComments;
+    private Collection[] comments = new Collection[3];
+    private static final int COMMENT_DOCUMENT_HEADER = 0;
+    private static final int COMMENT_DOCUMENT_TRAILER = 1;
+    private static final int COMMENT_PAGE_TRAILER = 2;
 
     /**
      * Default constructor.
@@ -180,12 +186,7 @@
         gen.writeDSCComment(DSCConstants.HIRES_BBOX, DSCConstants.ATEND);
         gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
                 new Object[] {DSCConstants.ATEND});
-        if (headerComments != null) {
-            for (Iterator iter = headerComments.iterator(); iter.hasNext();) {
-                PSExtensionAttachment comment = (PSExtensionAttachment)iter.next();
-                gen.writeln("%" + comment.getContent());
-            }
-        }
+        writeExtensions(COMMENT_DOCUMENT_HEADER);
         gen.writeDSCComment(DSCConstants.END_COMMENTS);
 
         //Defaults
@@ -225,13 +226,7 @@
         try {
             //Write trailer
             gen.writeDSCComment(DSCConstants.TRAILER);
-            if (footerComments != null) {
-                for (Iterator iter = footerComments.iterator(); iter.hasNext();) {
-                    PSExtensionAttachment comment = (PSExtensionAttachment)iter.next();
-                    gen.commentln("%" + comment.getContent());
-                }
-                footerComments.clear();
-            }
+            writeExtensions(COMMENT_DOCUMENT_TRAILER);
             gen.writeDSCComment(DSCConstants.PAGES, new Integer(this.currentPageNumber));
             new DSCCommentBoundingBox(this.documentBoundingBox).generate(gen);
             new DSCCommentHiResBoundingBox(this.documentBoundingBox).generate(gen);
@@ -243,9 +238,6 @@
                 IOUtils.closeQuietly(gen.getOutputStream());
                 rewritePostScriptFile();
             }
-            if (footerComments != null) {
-                headerComments.clear();
-            }
             if (pageDeviceDictionary != null) {
                 pageDeviceDictionary.clear();
             }
@@ -328,6 +320,8 @@
                 pageSizes.add(new Long(Math.round(pageHeight)));
             }
             pageDeviceDictionary.put("/PageSize", pageSizes);
+            this.currentPageDefinition = new PageDefinition(
+                    new Dimension2DDouble(pageWidth, pageHeight), rotate);
 
             //TODO Handle extension attachments for the page!!!!!!!
             /*
@@ -357,10 +351,6 @@
                 }
             }*/
 
-            if (setupCodeList != null) {
-                PSRenderingUtil.writeEnclosedExtensionAttachments(gen, setupCodeList);
-                setupCodeList.clear();
-            }
             final Integer zero = new Integer(0);
             Rectangle2D pageBoundingBox = new Rectangle2D.Double();
             if (rotate) {
@@ -390,26 +380,25 @@
                     new Object[] {DSCConstants.ATEND});
 
             gen.commentln("%FOPSimplePageMaster: " + pageMasterName);
+        } catch (IOException ioe) {
+            throw new IFException("I/O error in startPage()", ioe);
+        }
+    }
 
-            gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP);
+    /** {@inheritDoc} */
+    public void startPageHeader() throws IFException {
+        super.startPageHeader();
 
-            //TODO Handle extension attachments for the page!!!!!!!
-            /*
-            if (page.hasExtensionAttachments()) {
-                List extensionAttachments = page.getExtensionAttachments();
-                for (int i = 0; i < extensionAttachments.size(); i++) {
-                    Object attObj = extensionAttachments.get(i);
-                    if (attObj instanceof PSExtensionAttachment) {
-                        PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
-                        if (attachment instanceof PSCommentBefore) {
-                            gen.commentln("%" + attachment.getContent());
-                        } else if (attachment instanceof PSSetupCode) {
-                            gen.writeln(attachment.getContent());
-                        }
-                    }
-                }
-            }*/
+        try {
+            gen.writeDSCComment(DSCConstants.BEGIN_PAGE_SETUP);
+        } catch (IOException ioe) {
+            throw new IFException("I/O error in startPageHeader()", ioe);
+        }
+    }
 
+    /** {@inheritDoc} */
+    public void endPageHeader() throws IFException {
+        try {
             // Write any unwritten changes to page device dictionary
             if (!pageDeviceDictionary.isEmpty()) {
                 String content = pageDeviceDictionary.getContent();
@@ -421,15 +410,26 @@
                 PSRenderingUtil.writeEnclosedExtensionAttachment(gen, new PSSetPageDevice(content));
             }
 
-            if (rotate) {
-                gen.writeln(Math.round(pageHeight) + " 0 translate");
+            double pageHeight = this.currentPageDefinition.dimensions.getHeight();
+            if (this.currentPageDefinition.rotate) {
+                gen.writeln(gen.formatDouble(pageHeight) + " 0 translate");
                 gen.writeln("90 rotate");
             }
             gen.concatMatrix(1, 0, 0, -1, 0, pageHeight);
 
             gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
         } catch (IOException ioe) {
-            throw new IFException("I/O error in startPage()", ioe);
+            throw new IFException("I/O error in endPageHeader()", ioe);
+        }
+
+        super.endPageHeader();
+    }
+
+    private void writeExtensions(int which) throws IOException {
+        Collection extensions = comments[which];
+        if (extensions != null) {
+            PSRenderingUtil.writeEnclosedExtensionAttachments(gen, extensions);
+            extensions.clear();
         }
     }
 
@@ -449,34 +449,94 @@
     }
 
     /** {@inheritDoc} */
-    public void endPage() throws IFException {
+    public void startPageTrailer() throws IFException {
+        super.startPageTrailer();
         try {
             gen.writeDSCComment(DSCConstants.PAGE_TRAILER);
+        } catch (IOException ioe) {
+            throw new IFException("I/O error in startPageTrailer()", ioe);
+        }
+    }
 
-            //TODO Handle extension attachments for the page!!!!!!!
-            /*
-            if (page.hasExtensionAttachments()) {
-                List extensionAttachments = page.getExtensionAttachments();
-                for (int i = 0; i < extensionAttachments.size(); i++) {
-                    Object attObj = extensionAttachments.get(i);
-                    if (attObj instanceof PSExtensionAttachment) {
-                        PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
-                        if (attachment instanceof PSCommentAfter) {
-                            gen.commentln("%" + attachment.getContent());
-                        }
-                    }
-                }
-            }*/
+    /** {@inheritDoc} */
+    public void endPageTrailer() throws IFException {
+        try {
+            writeExtensions(COMMENT_PAGE_TRAILER);
+        } catch (IOException ioe) {
+            throw new IFException("I/O error in endPageTrailer()", ioe);
+        }
+        super.endPageTrailer();
+    }
+
+    /** {@inheritDoc} */
+    public void endPage() throws IFException {
+        try {
             gen.getResourceTracker().writeResources(true, gen);
         } catch (IOException ioe) {
             throw new IFException("I/O error in endPage()", ioe);
         }
+
+        this.currentPageDefinition = null;
+    }
+
+    private boolean inPage() {
+        return this.currentPageDefinition != null;
     }
 
     /** {@inheritDoc} */
     public void handleExtensionObject(Object extension) throws IFException {
-        log.debug("Don't know how to handle extension object. Ignoring: "
-                + extension + " (" + extension.getClass().getName() + ")");
+        try {
+            if (extension instanceof PSSetupCode) {
+                if (inPage()) {
+                    PSRenderingUtil.writeEnclosedExtensionAttachment(gen, (PSSetupCode)extension);
+                } else {
+                    //A special collection for setup code as it's put in a different place
+                    //than the "before comments".
+                    if (setupCodeList == null) {
+                        setupCodeList = new java.util.ArrayList();
+                    }
+                    if (!setupCodeList.contains(extension)) {
+                        setupCodeList.add(extension);
+                    }
+                }
+            } else if (extension instanceof PSSetPageDevice) {
+                /**
+                 * Extract all PSSetPageDevice instances from the
+                 * attachment list on the s-p-m and add all dictionary
+                 * entries to our internal representation of the the
+                 * page device dictionary.
+                 */
+                PSSetPageDevice setPageDevice = (PSSetPageDevice)extension;
+                String content = setPageDevice.getContent();
+                if (content != null) {
+                    try {
+                        this.pageDeviceDictionary.putAll(PSDictionary.valueOf(content));
+                    } catch (PSDictionaryFormatException e) {
+                        PSEventProducer eventProducer = PSEventProducer.Provider.get(
+                                getUserAgent().getEventBroadcaster());
+                        eventProducer.postscriptDictionaryParseError(this, content, e);
+                    }
+                }
+            } else if (extension instanceof PSCommentBefore) {
+                if (inPage()) {
+                    PSRenderingUtil.writeEnclosedExtensionAttachment(
+                            gen, (PSCommentBefore)extension);
+                } else {
+                    if (comments[COMMENT_DOCUMENT_HEADER] == null) {
+                        comments[COMMENT_DOCUMENT_HEADER] = new java.util.ArrayList();
+                    }
+                    comments[COMMENT_DOCUMENT_HEADER].add(extension);
+                }
+            } else if (extension instanceof PSCommentAfter) {
+                int targetCollection = (inPage() ? COMMENT_PAGE_TRAILER : COMMENT_DOCUMENT_TRAILER);
+                if (comments[targetCollection] == null) {
+                    comments[targetCollection] = new java.util.ArrayList();
+                }
+                comments[targetCollection].add(extension);
+            }
+        } catch (IOException ioe) {
+            throw new IFException("I/O error in handleExtensionObject()", ioe);
+        }
     }
 
     private String getPostScriptNameForFontKey(String key) {
@@ -540,4 +600,14 @@
         return form;
     }
 
+    private static final class PageDefinition {
+        private Dimension2D dimensions;
+        private boolean rotate;
+
+        private PageDefinition(Dimension2D dimensions, boolean rotate) {
+            this.dimensions = dimensions;
+            this.rotate = rotate;
+        }
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderingUtil.java?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
Mon Dec 22 10:23:03 2008
@@ -28,6 +28,8 @@
 import org.apache.xmlgraphics.ps.PSGenerator;
 
 import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.render.ps.extensions.PSCommentAfter;
+import org.apache.fop.render.ps.extensions.PSCommentBefore;
 import org.apache.fop.render.ps.extensions.PSExtensionAttachment;
 import org.apache.fop.render.ps.extensions.PSSetupCode;
 
@@ -157,26 +159,32 @@
      */
     public static void writeEnclosedExtensionAttachment(PSGenerator gen,
                 PSExtensionAttachment attachment) throws IOException {
-        String info = "";
-        if (attachment instanceof PSSetupCode) {
-            PSSetupCode setupCodeAttach = (PSSetupCode)attachment;
-            String name = setupCodeAttach.getName();
-            if (name != null) {
-                info += ": (" + name + ")";
+        if (attachment instanceof PSCommentBefore) {
+            gen.commentln("%" + attachment.getContent());
+        } else if (attachment instanceof PSCommentAfter) {
+            gen.commentln("%" + attachment.getContent());
+        } else {
+            String info = "";
+            if (attachment instanceof PSSetupCode) {
+                PSSetupCode setupCodeAttach = (PSSetupCode)attachment;
+                String name = setupCodeAttach.getName();
+                if (name != null) {
+                    info += ": (" + name + ")";
+                }
             }
-        }
-        String type = attachment.getType();
-        gen.commentln("%FOPBegin" + type + info);
-        LineNumberReader reader = new LineNumberReader(
-                new java.io.StringReader(attachment.getContent()));
-        String line;
-        while ((line = reader.readLine()) != null) {
-            line = line.trim();
-            if (line.length() > 0) {
-                gen.writeln(line);
+            String type = attachment.getType();
+            gen.commentln("%FOPBegin" + type + info);
+            LineNumberReader reader = new LineNumberReader(
+                    new java.io.StringReader(attachment.getContent()));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.length() > 0) {
+                    gen.writeln(line);
+                }
             }
+            gen.commentln("%FOPEnd" + type);
         }
-        gen.commentln("%FOPEnd" + type);
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_1.xml?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_1.xml
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_1.xml
Mon Dec 22 10:23:03 2008
@@ -65,4 +65,22 @@
     <eval expected="bla" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[2]/@name"/>
     <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*[2]"/>
   </checks>
+  <if-checks  xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
+    <eval expected="3" xpath="count(/if:document/if:header/child::*)"/>
+    <eval expected="%FOPTestPSSetupCode: General setup code here!" xpath="/if:document/if:header/child::*[1]"/>
+    <true xpath="contains(/if:document/if:header/child::*[2], '%FOPTestPSSetupCode: Line
1')"/>
+    <eval expected="multi-line" xpath="/if:document/if:header/child::*[2]/@name"/>
+    
+    <eval expected="2" xpath="count(//if:page[@index=0]/if:page-header/child::*)"/>
+    <eval expected="media-dict" xpath="//if:page[@index=0]/if:page-header/child::*[1]/@name"/>
+    <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="//if:page[@index=0]/if:page-header/child::*[1]"/>
+    <eval expected="bla" xpath="//if:page[@index=0]/if:page-header/child::*[2]/@name"/>
+    <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="//if:page[@index=0]/if:page-header/child::*[2]"/>
+    
+    <eval expected="2" xpath="count(//if:page[@index=1]/if:page-header/child::*)"/>
+    <eval expected="media-dict" xpath="//if:page[@index=1]/if:page-header/child::*[1]/@name"/>
+    <eval expected="%FOPTestPSPageSetupCode: MediaDict!" xpath="//if:page[@index=1]/if:page-header/child::*[1]"/>
+    <eval expected="bla" xpath="//if:page[@index=1]/if:page-header/child::*[2]/@name"/>
+    <eval expected="%FOPTestPSPageSetupCode: Blah blah!" xpath="//if:page[@index=1]/if:page-header/child::*[2]"/>
+  </if-checks>
 </testcase>

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_2.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_2.xml?rev=728737&r1=728736&r2=728737&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_2.xml
(original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/layoutengine/standard-testcases/ps-extension_2.xml
Mon Dec 22 10:23:03 2008
@@ -92,4 +92,33 @@
     <eval expected="A4 before page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=3]/page/extension-attachments/child::*[2]"/>
     <eval expected="A4 after page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=3]/page/extension-attachments/child::*[3]"/>
   </checks>
+  <if-checks  xmlns:if="http://xmlgraphics.apache.org/fop/intermediate">
+    <eval expected="1" xpath="count(/if:document/if:page-sequence)"/>
+    <eval expected="6" xpath="count(/if:document/if:header/child::*)"/>
+    <eval expected="autofeed"       xpath="/if:document/if:header/child::*[1]/@name"/>
+    <eval expected="header comment 1" xpath="/if:document/if:header/child::*[2]/text()"/>
+    <eval expected="footer comment 1" xpath="/if:document/if:header/child::*[3]/text()"/>
+    <eval expected="header comment 2" xpath="/if:document/if:header/child::*[4]/text()"/>
+    <eval expected="footer comment 2" xpath="/if:document/if:header/child::*[5]/text()"/>
+    
+    <eval expected="3" xpath="count(//if:page[@index=0]/if:page-header/child::*)"/>
+    <eval expected="A4" xpath="//if:page[@index=0]/@page-master-name"/>
+    <eval expected="lower tray" xpath="//if:page[@index=0]/if:page-header/child::*[1]/@name"/>
+    <eval expected="A4 before page" xpath="//if:page[@index=0]/if:page-header/child::*[2]"/>
+    <eval expected="A4 after page" xpath="//if:page[@index=0]/if:page-header/child::*[3]"/>
+    
+    <eval expected="5" xpath="count(//if:page[@index=1]/if:page-header/child::*)"/>
+    <eval expected="A4a" xpath="//if:page[@index=1]/@page-master-name"/>
+    <eval expected="upper tray" xpath="//if:page[@index=1]/if:page-header/child::*[1]/@name"/>
+    <eval expected="A4a before page 1" xpath="//if:page[@index=1]/if:page-header/child::*[2]"/>
+    <eval expected="A4a after page 1" xpath="//if:page[@index=1]/if:page-header/child::*[3]"/>
+    <eval expected="A4a before page 2" xpath="//if:page[@index=1]/if:page-header/child::*[4]"/>
+    <eval expected="A4a after page 2" xpath="//if:page[@index=1]/if:page-header/child::*[5]"/>
+    
+    <eval expected="3" xpath="count(//if:page[@index=2]/if:page-header/child::*)"/>
+    <eval expected="A4" xpath="//if:page[@index=2]/@page-master-name"/>
+    <eval expected="lower tray" xpath="//if:page[@index=2]/if:page-header/child::*[1]/@name"/>
+    <eval expected="A4 before page" xpath="//if:page[@index=2]/if:page-header/child::*[2]"/>
+    <eval expected="A4 after page" xpath="//if:page[@index=2]/if:page-header/child::*[3]"/>
+  </if-checks>  
 </testcase>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message