[FOray-commit] SF.net SVN: foray: [9212] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-18 21:20:56
|
Revision: 9212
http://svn.sourceforge.net/foray/?rev=9212&view=rev
Author: victormote
Date: 2007-04-18 14:20:58 -0700 (Wed, 18 Apr 2007)
Log Message:
-----------
Move, rename, and use another test file.
Modified Paths:
--------------
trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java
Added Paths:
-----------
trunk/foray/resource/test/fo/invalid-ns-002.fo
Removed Paths:
-------------
trunk/foray/resource/test/errors/
Modified: trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java 2007-04-18 21:14:41 UTC (rev 9211)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/TestInvalidXml.java 2007-04-18 21:20:58 UTC (rev 9212)
@@ -95,6 +95,22 @@
}
/**
+ * Test of fo/invalid-ns-002.fo, which contains an unregistered namespace
+ * inside some foreign xml.
+ * @throws FOrayException For errors creating the FO Tree.
+ */
+ public void testNamespace002() throws FOrayException {
+ final FoDocumentReader reader = FoDocumentReader.getInstance();
+ try {
+ reader.buildFoTree("fo/invalid-ns-002.fo");
+ fail("Expected FOrayException indicating an unregistered "
+ + "namespace.");
+ } catch (final FOrayException e) {
+ /* Do nothing. This is the expected case. */
+ }
+ }
+
+ /**
* Test of fo/invalid-fo-001.fo, which has no root element.
* @throws FOrayException For errors creating the FO Tree.
*/
Copied: trunk/foray/resource/test/fo/invalid-ns-002.fo (from rev 8434, trunk/foray/resource/test/errors/foreign.fo)
===================================================================
--- trunk/foray/resource/test/fo/invalid-ns-002.fo (rev 0)
+++ trunk/foray/resource/test/fo/invalid-ns-002.fo 2007-04-18 21:20:58 UTC (rev 9212)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master
+ margin-right="1.5cm"
+ margin-left="1.5cm"
+ margin-bottom="2cm"
+ margin-top="1cm"
+ page-width="21cm"
+ page-height="29.7cm"
+ master-name="first">
+ <fo:region-before extent="1cm"/>
+ <fo:region-body margin-top="1cm"/>
+ <fo:region-after extent="1.5cm"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence master-reference="first">
+ <fo:static-content flow-name="xsl-region-before">
+ <fo:block line-height="14pt" font-size="10pt"
+ text-align="end">Embedding SVG examples</fo:block>
+ </fo:static-content>
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block line-height="14pt" font-size="10pt"
+ text-align="end">Page <fo:page-number/></fo:block>
+ </fo:static-content>
+
+ <fo:flow flow-name="xsl-region-body">
+
+ <fo:block text-align="center" font-weight="bold" font-size="14pt" space-before.optimum="3pt" space-after.optimum="15pt">
+ Embedding SVG
+ </fo:block>
+
+ <fo:block space-before.optimum="3pt" space-after.optimum="20pt">
+<fo:instream-foreign-object>
+<foo xmlns="http://www.foo.com" width="20" height="20">
+ <g style="fill:red; stroke:#000000">
+ <rect x="0" y="0" width="15" height="15"/>
+ <rect x="5" y="5" width="15" height="15"/>
+ </g>
+</foo>
+</fo:instream-foreign-object>
+ </fo:block>
+
+ <fo:block space-before.optimum="5pt">
+<fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg">
+<svg:svg width="20" height="20">
+ <svg:g style="fill:red; stroke:#000000">
+ <svg:rect x="0" y="0" width="15" height="15"/>
+ <svg:rect x="5" y="5" width="15" height="15"/>
+ </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+ </fo:block>
+
+<foo xmlns="http://www.foo.com" width="20" height="20">
+ <g style="fill:red; stroke:#000000">
+ <rect x="0" y="0" width="15" height="15"/>
+ <rect x="5" y="5" width="15" height="15"/>
+ </g>
+</foo>
+
+<foo width="20" height="20">
+ <rect x="5" y="5" width="15" height="15"/>
+</foo>
+
+<fo:foo width="20" height="20">
+ <fo:rect x="5" y="5" width="15" height="15"/>
+</fo:foo>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|