if (nd != null) {
this.tolerance = Double.parseDouble(nd.getNodeValue());
}
- this.prefixResolver = new MyPrefixResolver(new PrefixResolverDefault(node));
+ this.prefixResolver = new PrefixResolverDefault(node);
}
/** {@inheritDoc} */
return "XPath: " + xpath;
}
- private static class MyPrefixResolver implements PrefixResolver {
-
- private PrefixResolver delegate;
-
- public MyPrefixResolver(PrefixResolver delegate) {
- this.delegate = delegate;
- }
-
- /** {@inheritDoc} */
- public String getBaseIdentifier() {
- String s = delegate.getBaseIdentifier();
- System.out.println(s);
- return s;
- }
-
- /** {@inheritDoc} */
- public String getNamespaceForPrefix(String prefix) {
- String s = delegate.getNamespaceForPrefix(prefix);
- System.out.println(s);
- return s;
- }
-
- /** {@inheritDoc} */
- public String getNamespaceForPrefix(String prefix, Node context) {
- String s = delegate.getNamespaceForPrefix(prefix, context);
- System.out.println(s);
- return s;
- }
-
- /** {@inheritDoc} */
- public boolean handlesNullPrefixes() {
- return delegate.handlesNullPrefixes();
- }
-
- }
-
}
<eval expected="(P2,chapter2-sec1)" xpath="//bookmarkTree/bookmark[2]/bookmark[1]/@internal-link"/>
<eval expected="(P2,chapter2-sec2)" xpath="//bookmarkTree/bookmark[2]/bookmark[2]/@internal-link"/>
</checks>
- <if-checks xmlns:bm="http://xmlgraphics.apache.org/fop/intermediate/bookmarks">
- <eval expected="show" xpath="//bm:bookmark-tree/bm:bookmark[1]/@starting-state"/>
- <eval expected="Chapter 1" xpath="//bm:bookmark-tree/bm:bookmark[1]/@title"/>
- <eval expected="0" xpath="//bm:bookmark-tree/bm:bookmark[1]/bm:goto-xy/@page-index"/>
- <eval expected="20000" xpath="//bm:bookmark-tree/bm:bookmark[1]/bm:goto-xy/@x"/>
- <eval expected="20000" xpath="//bm:bookmark-tree/bm:bookmark[1]/bm:goto-xy/@y"/>
+ <if-checks xmlns:n="http://xmlgraphics.apache.org/fop/intermediate/document-navigation">
+ <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[1]/@starting-state"/>
+ <eval expected="Chapter 1" xpath="//n:bookmark-tree/n:bookmark[1]/@title"/>
+ <eval expected="0" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@page-index"/>
+ <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@x"/>
+ <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[1]/n:goto-xy/@y"/>
- <eval expected="hide" xpath="//bm:bookmark-tree/bm:bookmark[2]/@starting-state"/>
- <eval expected="Chapter 2" xpath="//bm:bookmark-tree/bm:bookmark[2]/@title"/>
- <eval expected="1" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:goto-xy/@page-index"/>
- <eval expected="20000" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:goto-xy/@x"/>
- <eval expected="20000" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:goto-xy/@y"/>
+ <eval expected="hide" xpath="//n:bookmark-tree/n:bookmark[2]/@starting-state"/>
+ <eval expected="Chapter 2" xpath="//n:bookmark-tree/n:bookmark[2]/@title"/>
+ <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@page-index"/>
+ <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@x"/>
+ <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:goto-xy/@y"/>
- <eval expected="show" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:bookmark[1]/@starting-state"/>
- <eval expected="Section 1" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:bookmark[1]/@title"/>
- <eval expected="1" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:bookmark[1]/bm:goto-xy/@page-index"/>
- <eval expected="20000" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:bookmark[1]/bm:goto-xy/@x"/>
- <eval expected="51680" xpath="//bm:bookmark-tree/bm:bookmark[2]/bm:bookmark[1]/bm:goto-xy/@y"/>
+ <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/@starting-state"/>
+ <eval expected="Section 1" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/@title"/>
+ <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@page-index"/>
+ <eval expected="20000" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@x"/>
+ <eval expected="51680" xpath="//n:bookmark-tree/n:bookmark[2]/n:bookmark[1]/n:goto-xy/@y"/>
- <eval expected="show" xpath="//bm:bookmark-tree/bm:bookmark[3]/@starting-state"/>
- <eval expected="Fixed Block Container" xpath="//bm:bookmark-tree/bm:bookmark[3]/@title"/>
- <eval expected="1" xpath="//bm:bookmark-tree/bm:bookmark[3]/bm:goto-xy/@page-index"/>
- <eval expected="216000" xpath="//bm:bookmark-tree/bm:bookmark[3]/bm:goto-xy/@x"/>
- <eval expected="216000" xpath="//bm:bookmark-tree/bm:bookmark[3]/bm:goto-xy/@y"/>
+ <eval expected="show" xpath="//n:bookmark-tree/n:bookmark[3]/@starting-state"/>
+ <eval expected="Fixed Block Container" xpath="//n:bookmark-tree/n:bookmark[3]/@title"/>
+ <eval expected="1" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@page-index"/>
+ <eval expected="216000" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@x"/>
+ <eval expected="216000" xpath="//n:bookmark-tree/n:bookmark[3]/n:goto-xy/@y"/>
</if-checks>
</testcase>
<eval expected="(P2,chapter2-sec1)" xpath="//destination[3]/@internal-link"/>
<eval expected="(P2,chapter2-sec2)" xpath="//destination[4]/@internal-link"/>
</checks>
+ <if-checks xmlns:n="http://xmlgraphics.apache.org/fop/intermediate/document-navigation">
+ <eval expected="0" xpath="//n:named-destination[@name='chapter1']/n:goto-xy/@page-index"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter1']/n:goto-xy/@x"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter1']/n:goto-xy/@y"/>
+
+ <eval expected="1" xpath="//n:named-destination[@name='chapter2']/n:goto-xy/@page-index"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter2']/n:goto-xy/@x"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter2']/n:goto-xy/@y"/>
+
+ <eval expected="1" xpath="//n:named-destination[@name='chapter2-sec1']/n:goto-xy/@page-index"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter2-sec1']/n:goto-xy/@x"/>
+ <eval expected="31680" xpath="//n:named-destination[@name='chapter2-sec1']/n:goto-xy/@y"/>
+
+ <eval expected="1" xpath="//n:named-destination[@name='chapter2-sec2']/n:goto-xy/@page-index"/>
+ <eval expected="0" xpath="//n:named-destination[@name='chapter2-sec2']/n:goto-xy/@x"/>
+ <eval expected="60480" xpath="//n:named-destination[@name='chapter2-sec2']/n:goto-xy/@y"/>
+ </if-checks>
</testcase>