aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop/layoutengine
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-05-18 12:44:15 +0000
committerJeremias Maerki <jeremias@apache.org>2006-05-18 12:44:15 +0000
commiteb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2 (patch)
tree64aee903db63f0864ec696bc32b6e62a5e10596a /test/java/org/apache/fop/layoutengine
parent436c9f26ea62ed151f38a5eaf4e5e69fa67afda1 (diff)
downloadxmlgraphics-fop-eb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2.tar.gz
xmlgraphics-fop-eb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2.zip
Extended PageViewport to carry foreign attributes.
Foreign attributes from simple-page-master are transferred to the PageViewport. Added foreign attributes handling in AreaTreeParser. Fixed proper generation of foreign attributes in XMLRenderer. EvalCheck extended so it can use namespace prefix mappings in its context. Test case for foreign attributes. Paper source/tray support for PCL (pcl:paper-source="<tray-code>" on s-p-m) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@407541 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/layoutengine')
-rw-r--r--test/java/org/apache/fop/layoutengine/EvalCheck.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/java/org/apache/fop/layoutengine/EvalCheck.java b/test/java/org/apache/fop/layoutengine/EvalCheck.java
index be71e50fb..0b3d98afb 100644
--- a/test/java/org/apache/fop/layoutengine/EvalCheck.java
+++ b/test/java/org/apache/fop/layoutengine/EvalCheck.java
@@ -20,6 +20,8 @@ package org.apache.fop.layoutengine;
import javax.xml.transform.TransformerException;
+import org.apache.xml.utils.PrefixResolver;
+import org.apache.xml.utils.PrefixResolverDefault;
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
import org.w3c.dom.Node;
@@ -31,6 +33,7 @@ public class EvalCheck implements LayoutEngineCheck {
private String expected;
private String xpath;
+ private PrefixResolver prefixResolver;
/**
* Creates a new instance
@@ -49,13 +52,14 @@ public class EvalCheck implements LayoutEngineCheck {
public EvalCheck(Node node) {
this.expected = node.getAttributes().getNamedItem("expected").getNodeValue();
this.xpath = node.getAttributes().getNamedItem("xpath").getNodeValue();
+ this.prefixResolver = new PrefixResolverDefault(node);
}
/** @see org.apache.fop.layoutengine.LayoutEngineCheck */
public void check(LayoutResult result) {
XObject res;
try {
- res = XPathAPI.eval(result.getAreaTree(), xpath);
+ res = XPathAPI.eval(result.getAreaTree(), xpath, prefixResolver);
} catch (TransformerException e) {
throw new RuntimeException("XPath evaluation failed: " + e.getMessage());
}
@@ -72,5 +76,13 @@ public class EvalCheck implements LayoutEngineCheck {
public String toString() {
return "XPath: " + xpath;
}
+
+ private class MyPrefixResolver extends PrefixResolverDefault {
+
+ public MyPrefixResolver(Node xpathExpressionContext) {
+ super(xpathExpressionContext);
+ }
+
+ }
}