From 6851a8efe0544cb6d17f19a7d05a225400ccf0bb Mon Sep 17 00:00:00 2001 From: fotis Date: Tue, 14 Mar 2000 09:43:09 +0000 Subject: [PATCH] new fop examples and tests git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193299 13f79535-47bb-0310-9956-ffa450edef68 --- docs/examples/build.xml | 95 +++++++++ docs/examples/list.fo | 135 ------------- docs/examples/list.pdf | 282 --------------------------- docs/examples/normal.fo | 128 ------------ docs/examples/normal.pdf | 386 ------------------------------------- docs/examples/results.html | 12 ++ docs/examples/runtests.bat | 26 +++ docs/examples/table.fo | 137 ------------- docs/examples/table.pdf | 203 ------------------- lib/Compare.class | Bin 0 -> 5086 bytes lib/Compare.java | 146 ++++++++++++++ lib/Fop.class | Bin 0 -> 4214 bytes lib/Fop.java | 122 ++++++++++++ lib/Xslt.class | Bin 2614 -> 3929 bytes lib/Xslt.java | 350 ++++++++++++++++++++------------- 15 files changed, 615 insertions(+), 1407 deletions(-) create mode 100644 docs/examples/build.xml delete mode 100644 docs/examples/list.fo delete mode 100644 docs/examples/list.pdf delete mode 100644 docs/examples/normal.fo delete mode 100644 docs/examples/normal.pdf create mode 100644 docs/examples/results.html create mode 100755 docs/examples/runtests.bat delete mode 100644 docs/examples/table.fo delete mode 100644 docs/examples/table.pdf create mode 100644 lib/Compare.class create mode 100644 lib/Compare.java create mode 100644 lib/Fop.class create mode 100644 lib/Fop.java diff --git a/docs/examples/build.xml b/docs/examples/build.xml new file mode 100644 index 000000000..85e3007a9 --- /dev/null +++ b/docs/examples/build.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/examples/list.fo b/docs/examples/list.fo deleted file mode 100644 index 90c673474..000000000 --- a/docs/examples/list.fo +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - XSL-FO Example: simple list - p. - - - - - - - - Validity Constraint: Standalone Document Declaration - - - - - The standalone document declaration must have the value "no" if - any external markup declarations contain declarations of: - - - - - - - - - - - - - - - attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or - - - - - - - - - - - - - - entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or - - - - - - - - - - - - - - attributes with values subject to normalization, where the attribute appears in the document with a value which will - - - - - - - - - - - - - - change as a result of normalization, or - - - - - - - - - - - - - - element types with element content, if white space occurs directly within any instance of those types. - - - - - - - - - - - - diff --git a/docs/examples/list.pdf b/docs/examples/list.pdf deleted file mode 100644 index f5dbeb5f1..000000000 --- a/docs/examples/list.pdf +++ /dev/null @@ -1,282 +0,0 @@ -%PDF-1.2 -1 0 obj -<< /Type /Catalog -/Pages 2 0 R >> -endobj -2 0 obj -<< /Type /Pages -/Count 0 -/Kids [18 0 R ] >> -endobj -3 0 obj -<< /Type /Info -/Producer (FOP 0.12.1[dev]) >> -endobj -4 0 obj -<< /Font << /F11 5 0 R -/F10 6 0 R -/F9 7 0 R -/F8 8 0 R -/F7 9 0 R -/F6 10 0 R -/F5 11 0 R -/F4 12 0 R -/F3 13 0 R -/F2 14 0 R -/F1 15 0 R -/F12 16 0 R ->> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -5 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F11 -/BaseFont /Courier-Bold -/Encoding /WinAnsiEncoding >> -endobj -6 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F10 -/BaseFont /Courier-Oblique -/Encoding /WinAnsiEncoding >> -endobj -7 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F9 -/BaseFont /Courier -/Encoding /WinAnsiEncoding >> -endobj -8 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F8 -/BaseFont /Times-BoldItalic -/Encoding /WinAnsiEncoding >> -endobj -9 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F7 -/BaseFont /Times-Bold -/Encoding /WinAnsiEncoding >> -endobj -10 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F6 -/BaseFont /Times-Italic -/Encoding /WinAnsiEncoding >> -endobj -11 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -12 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F4 -/BaseFont /Helvetica-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -13 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F3 -/BaseFont /Helvetica-Bold -/Encoding /WinAnsiEncoding >> -endobj -14 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F2 -/BaseFont /Helvetica-Oblique -/Encoding /WinAnsiEncoding >> -endobj -15 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -16 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F12 -/BaseFont /Courier-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -17 0 obj -<< /Length 4557 >> -stream -BT -1 0 0 1 70.875 678.6 Tm -/F3 14 Tf -1 0 0 1 85.875 663.548 Tm (Validity) Tj -1 0 0 1 139.565 663.548 Tm (Constraint:) Tj -1 0 0 1 218.119 663.548 Tm (Standalone) Tj -1 0 0 1 297.471 663.548 Tm (Document) Tj -1 0 0 1 369.809 663.548 Tm (Declaration) Tj -/F1 12 Tf -1 0 0 1 70.875 645.534 Tm (The) Tj -1 0 0 1 94.887 645.534 Tm (standalone) Tj -1 0 0 1 156.927 645.534 Tm (document) Tj -1 0 0 1 212.955 645.534 Tm (declaration) Tj -1 0 0 1 274.983 645.534 Tm (must) Tj -1 0 0 1 304.323 645.534 Tm (have) Tj -1 0 0 1 333.675 645.534 Tm (the) Tj -1 0 0 1 353.691 645.534 Tm (value) Tj -1 0 0 1 385.707 645.534 Tm ("no") Tj -1 0 0 1 410.907 645.534 Tm (if) Tj -1 0 0 1 420.243 645.534 Tm (any) Tj -1 0 0 1 442.923 645.534 Tm (external) Tj -1 0 0 1 70.875 631.434 Tm (markup) Tj -1 0 0 1 114.219 631.434 Tm (declarations) Tj -1 0 0 1 182.247 631.434 Tm (contain) Tj -1 0 0 1 224.271 631.434 Tm (declarations) Tj -1 0 0 1 292.299 631.434 Tm (of:) Tj -1 0 0 1 70.875 614.634 Tm (\225) Tj -1 0 0 1 94.875 614.634 Tm (attributes) Tj -1 0 0 1 147.567 614.634 Tm (with) Tj -1 0 0 1 172.239 614.634 Tm (default) Tj -1 0 0 1 211.599 614.634 Tm (values,) Tj -1 0 0 1 252.951 614.634 Tm (if) Tj -1 0 0 1 262.287 614.634 Tm (elements) Tj -1 0 0 1 314.307 614.634 Tm (to) Tj -1 0 0 1 327.651 614.634 Tm (which) Tj -1 0 0 1 361.659 614.634 Tm (these) Tj -1 0 0 1 394.347 614.634 Tm (attributes) Tj -1 0 0 1 447.039 614.634 Tm (apply) Tj -1 0 0 1 94.875 601.134 Tm (appear) Tj -1 0 0 1 135.567 601.134 Tm (in) Tj -1 0 0 1 148.239 601.134 Tm (the) Tj -1 0 0 1 168.255 601.134 Tm (document) Tj -1 0 0 1 224.283 601.134 Tm (without) Tj -1 0 0 1 265.635 601.134 Tm (specifications) Tj -1 0 0 1 340.995 601.134 Tm (of) Tj -1 0 0 1 354.339 601.134 Tm (values) Tj -1 0 0 1 392.355 601.134 Tm (for) Tj -1 0 0 1 409.695 601.134 Tm (these) Tj -1 0 0 1 442.383 601.134 Tm (attributes,) Tj -1 0 0 1 94.875 587.634 Tm (or) Tj -1 0 0 1 70.875 574.134 Tm (\225) Tj -1 0 0 1 94.875 574.134 Tm (entities) Tj -1 0 0 1 136.227 574.134 Tm (\(other) Tj -1 0 0 1 170.907 574.134 Tm (than) Tj -1 0 0 1 197.595 574.134 Tm (amp,) Tj -1 0 0 1 227.607 574.134 Tm (lt,) Tj -1 0 0 1 240.279 574.134 Tm (gt,) Tj -1 0 0 1 256.959 574.134 Tm (apos,) Tj -1 0 0 1 289.647 574.134 Tm (quot\),) Tj -1 0 0 1 323.667 574.134 Tm (if) Tj -1 0 0 1 333.003 574.134 Tm (references) Tj -1 0 0 1 393.027 574.134 Tm (to) Tj -1 0 0 1 406.371 574.134 Tm (those) Tj -1 0 0 1 439.059 574.134 Tm (entities) Tj -1 0 0 1 94.875 560.634 Tm (appear) Tj -1 0 0 1 135.567 560.634 Tm (in) Tj -1 0 0 1 148.239 560.634 Tm (the) Tj -1 0 0 1 168.255 560.634 Tm (document,) Tj -1 0 0 1 227.619 560.634 Tm (or) Tj -1 0 0 1 70.875 547.134 Tm (\225) Tj -1 0 0 1 94.875 547.134 Tm (attributes) Tj -1 0 0 1 147.567 547.134 Tm (with) Tj -1 0 0 1 172.239 547.134 Tm (values) Tj -1 0 0 1 210.255 547.134 Tm (subject) Tj -1 0 0 1 251.607 547.134 Tm (to) Tj -1 0 0 1 264.951 547.134 Tm (normalization,) Tj -1 0 0 1 342.975 547.134 Tm (where) Tj -1 0 0 1 378.987 547.134 Tm (the) Tj -1 0 0 1 399.003 547.134 Tm (attribute) Tj -1 0 0 1 445.695 547.134 Tm (appears) Tj -1 0 0 1 492.387 547.134 Tm (in) Tj -1 0 0 1 94.875 533.634 Tm (the) Tj -1 0 0 1 114.891 533.634 Tm (document) Tj -1 0 0 1 170.919 533.634 Tm (with) Tj -1 0 0 1 195.591 533.634 Tm (a) Tj -1 0 0 1 205.599 533.634 Tm (value) Tj -1 0 0 1 237.615 533.634 Tm (which) Tj -1 0 0 1 271.623 533.634 Tm (will) Tj -1 0 0 1 70.875 520.134 Tm (\225) Tj -1 0 0 1 94.875 520.134 Tm (change) Tj -1 0 0 1 137.571 520.134 Tm (as) Tj -1 0 0 1 153.579 520.134 Tm (a) Tj -1 0 0 1 163.587 520.134 Tm (result) Tj -1 0 0 1 196.263 520.134 Tm (of) Tj -1 0 0 1 209.607 520.134 Tm (normalization,) Tj -1 0 0 1 287.631 520.134 Tm (or) Tj -1 0 0 1 70.875 506.634 Tm (\225) Tj -1 0 0 1 94.875 506.634 Tm (element) Tj -1 0 0 1 140.895 506.634 Tm (types) Tj -1 0 0 1 172.911 506.634 Tm (with) Tj -1 0 0 1 197.583 506.634 Tm (element) Tj -1 0 0 1 243.603 506.634 Tm (content,) Tj -1 0 0 1 289.635 506.634 Tm (if) Tj -1 0 0 1 298.971 506.634 Tm (white) Tj -1 0 0 1 330.315 506.634 Tm (space) Tj -1 0 0 1 365.667 506.634 Tm (occurs) Tj -1 0 0 1 404.343 506.634 Tm (directly) Tj -1 0 0 1 445.683 506.634 Tm (within) Tj -1 0 0 1 479.691 506.634 Tm (any) Tj -1 0 0 1 94.875 493.134 Tm (instance) Tj -1 0 0 1 142.899 493.134 Tm (of) Tj -1 0 0 1 156.243 493.134 Tm (those) Tj -1 0 0 1 188.931 493.134 Tm (types.) Tj -1 0 0 1 70.875 763.65 Tm -/F5 10 Tf -1 0 0 1 359.565 754.82 Tm (XSL-FO) Tj -1 0 0 1 397.065 754.82 Tm (Example:) Tj -1 0 0 1 437.895 754.82 Tm (simple) Tj -1 0 0 1 467.065 754.82 Tm (list) Tj -1 0 0 1 481.795 754.82 Tm (-) Tj -1 0 0 1 487.625 754.82 Tm (p.) Tj -1 0 0 1 497.625 754.82 Tm (1) Tj -1 0 0 1 70.875 99.225 Tm -ET - -endstream -endobj -18 0 obj -<< /Type /Page -/Parent 2 0 R -/MediaBox [ 0 0 576 792 ] -/Resources 4 0 R -/Contents 17 0 R ->> -endobj -xref -0 19 -0000000000 65535 f -0000000009 00000 n -0000000058 00000 n -0000000117 00000 n -0000000178 00000 n -0000000373 00000 n -0000000484 00000 n -0000000598 00000 n -0000000703 00000 n -0000000817 00000 n -0000000925 00000 n -0000001036 00000 n -0000001146 00000 n -0000001266 00000 n -0000001379 00000 n -0000001495 00000 n -0000001603 00000 n -0000001722 00000 n -0000006331 00000 n -trailer -<< -/Size 19 -/Root 1 0 R -/Info 3 0 R ->> -startxref -6439 -%%EOF diff --git a/docs/examples/normal.fo b/docs/examples/normal.fo deleted file mode 100644 index a15753784..000000000 --- a/docs/examples/normal.fo +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XML Recommendation - p. - - - - - - - - Extensible Markup Language (XML) 1.0 - - - - - Abstract - - - - - The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to - enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML - has been designed for ease of implementation and for interoperability with both SGML and HTML. - - - - - Status of this document - - - - - This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a - W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from - another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its - widespread deployment. This enhances the functionality and interoperability of the Web. - - - - - This document specifies a syntax created by subsetting an existing, widely used international text processing standard - (Standard Generalized Markup Language, ISO 8879:1986(E) as amended and corrected) for use on the World Wide Web. It - is a product of the W3C XML Activity, details of which can be found at http://www.w3.org/XML. A list of current W3C - Recommendations and other technical documents can be found at http://www.w3.org/TR. - - - - diff --git a/docs/examples/normal.pdf b/docs/examples/normal.pdf deleted file mode 100644 index ea48e1da6..000000000 --- a/docs/examples/normal.pdf +++ /dev/null @@ -1,386 +0,0 @@ -%PDF-1.2 -1 0 obj -<< /Type /Catalog -/Pages 2 0 R >> -endobj -2 0 obj -<< /Type /Pages -/Count 0 -/Kids [18 0 R ] >> -endobj -3 0 obj -<< /Type /Info -/Producer (FOP 0.12.1[dev]) >> -endobj -4 0 obj -<< /Font << /F11 5 0 R -/F10 6 0 R -/F9 7 0 R -/F8 8 0 R -/F7 9 0 R -/F6 10 0 R -/F5 11 0 R -/F4 12 0 R -/F3 13 0 R -/F2 14 0 R -/F1 15 0 R -/F12 16 0 R ->> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -5 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F11 -/BaseFont /Courier-Bold -/Encoding /WinAnsiEncoding >> -endobj -6 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F10 -/BaseFont /Courier-Oblique -/Encoding /WinAnsiEncoding >> -endobj -7 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F9 -/BaseFont /Courier -/Encoding /WinAnsiEncoding >> -endobj -8 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F8 -/BaseFont /Times-BoldItalic -/Encoding /WinAnsiEncoding >> -endobj -9 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F7 -/BaseFont /Times-Bold -/Encoding /WinAnsiEncoding >> -endobj -10 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F6 -/BaseFont /Times-Italic -/Encoding /WinAnsiEncoding >> -endobj -11 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -12 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F4 -/BaseFont /Helvetica-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -13 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F3 -/BaseFont /Helvetica-Bold -/Encoding /WinAnsiEncoding >> -endobj -14 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F2 -/BaseFont /Helvetica-Oblique -/Encoding /WinAnsiEncoding >> -endobj -15 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -16 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F12 -/BaseFont /Courier-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -17 0 obj -<< /Length 8284 >> -stream -BT -1 0 0 1 70.875 678.6 Tm -0.0 0.0 1.0 rg -0.0 0.0 1.0 RG -70.875 681.6 434.25 -25.65 re S -70.875 681.6 434.25 -25.65 re f -0 0 0 RG 0 0 0 rg -/F1 18 Tf -1.0 1.0 1.0 rg -1 0 0 1 126.927 662.676 Tm (Extensible) Tj -1 0 0 1 214.965 662.676 Tm (Markup) Tj -1 0 0 1 279.981 662.676 Tm (Language) Tj -1 0 0 1 365.049 662.676 Tm (\(XML\)) Tj -1 0 0 1 419.049 662.676 Tm (1.0) Tj -/F1 16 Tf -0.0 0.0 0.0 rg -1 0 0 1 70.875 617.462 Tm (Abstract) Tj -/F1 12 Tf -1 0 0 1 70.875 592.034 Tm (The) Tj -1 0 0 1 94.887 592.034 Tm (Extensible) Tj -1 0 0 1 153.579 592.034 Tm (Markup) Tj -1 0 0 1 196.923 592.034 Tm (Language) Tj -1 0 0 1 253.635 592.034 Tm (\(XML\)) Tj -1 0 0 1 289.635 592.034 Tm (is) Tj -1 0 0 1 301.635 592.034 Tm (a) Tj -1 0 0 1 311.643 592.034 Tm (subset) Tj -1 0 0 1 350.331 592.034 Tm (of) Tj -1 0 0 1 363.675 592.034 Tm (SGML) Tj -1 0 0 1 401.019 592.034 Tm (that) Tj -1 0 0 1 424.371 592.034 Tm (is) Tj -1 0 0 1 436.371 592.034 Tm (completely) Tj -1 0 0 1 70.875 577.934 Tm (described) Tj -1 0 0 1 126.231 577.934 Tm (in) Tj -1 0 0 1 138.903 577.934 Tm (this) Tj -1 0 0 1 160.911 577.934 Tm (document.) Tj -1 0 0 1 220.275 577.934 Tm (Its) Tj -1 0 0 1 236.283 577.934 Tm (goal) Tj -1 0 0 1 262.299 577.934 Tm (is) Tj -1 0 0 1 274.299 577.934 Tm (to) Tj -1 0 0 1 287.643 577.934 Tm (enable) Tj -1 0 0 1 327.003 577.934 Tm (generic) Tj -1 0 0 1 369.687 577.934 Tm (SGML) Tj -1 0 0 1 407.031 577.934 Tm (to) Tj -1 0 0 1 420.375 577.934 Tm (be) Tj -1 0 0 1 437.055 577.934 Tm (served,) Tj -1 0 0 1 70.875 563.834 Tm (received,) Tj -1 0 0 1 122.895 563.834 Tm (and) Tj -1 0 0 1 146.247 563.834 Tm (processed) Tj -1 0 0 1 204.939 563.834 Tm (on) Tj -1 0 0 1 221.619 563.834 Tm (the) Tj -1 0 0 1 241.635 563.834 Tm (Web) Tj -1 0 0 1 269.643 563.834 Tm (in) Tj -1 0 0 1 282.315 563.834 Tm (the) Tj -1 0 0 1 302.331 563.834 Tm (way) Tj -1 0 0 1 327.003 563.834 Tm (that) Tj -1 0 0 1 350.355 563.834 Tm (is) Tj -1 0 0 1 362.355 563.834 Tm (now) Tj -1 0 0 1 387.699 563.834 Tm (possible) Tj -1 0 0 1 435.051 563.834 Tm (with) Tj -1 0 0 1 459.723 563.834 Tm (HTML.) Tj -1 0 0 1 70.875 549.734 Tm (XML) Tj -1 0 0 1 98.883 549.734 Tm (has) Tj -1 0 0 1 121.563 549.734 Tm (been) Tj -1 0 0 1 151.587 549.734 Tm (designed) Tj -1 0 0 1 203.619 549.734 Tm (for) Tj -1 0 0 1 220.959 549.734 Tm (ease) Tj -1 0 0 1 250.311 549.734 Tm (of) Tj -1 0 0 1 263.655 549.734 Tm (implementation) Tj -1 0 0 1 348.351 549.734 Tm (and) Tj -1 0 0 1 371.703 549.734 Tm (for) Tj -1 0 0 1 389.043 549.734 Tm (interoperability) Tj -1 0 0 1 470.403 549.734 Tm (with) Tj -1 0 0 1 70.875 535.634 Tm (both) Tj -1 0 0 1 97.563 535.634 Tm (SGML) Tj -1 0 0 1 134.907 535.634 Tm (and) Tj -1 0 0 1 158.259 535.634 Tm (HTML.) Tj -/F1 16 Tf -1 0 0 1 70.875 505.162 Tm (Status) Tj -1 0 0 1 120.683 505.162 Tm (of) Tj -1 0 0 1 138.475 505.162 Tm (this) Tj -1 0 0 1 167.819 505.162 Tm (document) Tj -/F1 12 Tf -1 0 0 1 70.875 479.734 Tm (This) Tj -1 0 0 1 96.879 479.734 Tm (document) Tj -1 0 0 1 152.907 479.734 Tm (has) Tj -1 0 0 1 175.587 479.734 Tm (been) Tj -1 0 0 1 205.611 479.734 Tm (reviewed) Tj -1 0 0 1 256.959 479.734 Tm (by) Tj -1 0 0 1 272.967 479.734 Tm (W3C) Tj -1 0 0 1 302.967 479.734 Tm (Members) Tj -1 0 0 1 356.307 479.734 Tm (and) Tj -1 0 0 1 379.659 479.734 Tm (other) Tj -1 0 0 1 410.343 479.734 Tm (interested) Tj -1 0 0 1 466.371 479.734 Tm (parties) Tj -1 0 0 1 70.875 465.634 Tm (and) Tj -1 0 0 1 94.227 465.634 Tm (has) Tj -1 0 0 1 116.907 465.634 Tm (been) Tj -1 0 0 1 146.931 465.634 Tm (endorsed) Tj -1 0 0 1 200.295 465.634 Tm (by) Tj -1 0 0 1 216.303 465.634 Tm (the) Tj -1 0 0 1 236.319 465.634 Tm (Director) Tj -1 0 0 1 281.655 465.634 Tm (as) Tj -1 0 0 1 297.663 465.634 Tm (a) Tj -1 0 0 1 307.671 465.634 Tm (W3C) Tj -1 0 0 1 337.671 465.634 Tm (Recommendation.) Tj -1 0 0 1 438.375 465.634 Tm (It) Tj -1 0 0 1 448.383 465.634 Tm (is) Tj -1 0 0 1 460.383 465.634 Tm (a) Tj -1 0 0 1 470.391 465.634 Tm (stable) Tj -1 0 0 1 70.875 451.534 Tm (document) Tj -1 0 0 1 126.903 451.534 Tm (and) Tj -1 0 0 1 150.255 451.534 Tm (may) Tj -1 0 0 1 176.259 451.534 Tm (be) Tj -1 0 0 1 192.939 451.534 Tm (used) Tj -1 0 0 1 222.291 451.534 Tm (as) Tj -1 0 0 1 238.299 451.534 Tm (reference) Tj -1 0 0 1 292.323 451.534 Tm (material) Tj -1 0 0 1 338.331 451.534 Tm (or) Tj -1 0 0 1 352.335 451.534 Tm (cited) Tj -1 0 0 1 381.015 451.534 Tm (as) Tj -1 0 0 1 397.023 451.534 Tm (a) Tj -1 0 0 1 407.031 451.534 Tm (normative) Tj -1 0 0 1 70.875 437.434 Tm (reference) Tj -1 0 0 1 124.899 437.434 Tm (from) Tj -1 0 0 1 152.235 437.434 Tm (another) Tj -1 0 0 1 196.263 437.434 Tm (document.) Tj -1 0 0 1 255.627 437.434 Tm (W3C's) Tj -1 0 0 1 293.919 437.434 Tm (role) Tj -1 0 0 1 317.259 437.434 Tm (in) Tj -1 0 0 1 329.931 437.434 Tm (making) Tj -1 0 0 1 371.943 437.434 Tm (the) Tj -1 0 0 1 391.959 437.434 Tm (Recommendation) Tj -1 0 0 1 489.327 437.434 Tm (is) Tj -1 0 0 1 70.875 423.334 Tm (to) Tj -1 0 0 1 84.219 423.334 Tm (draw) Tj -1 0 0 1 113.559 423.334 Tm (attention) Tj -1 0 0 1 162.927 423.334 Tm (to) Tj -1 0 0 1 176.271 423.334 Tm (the) Tj -1 0 0 1 196.287 423.334 Tm (specification) Tj -1 0 0 1 265.647 423.334 Tm (and) Tj -1 0 0 1 288.999 423.334 Tm (to) Tj -1 0 0 1 302.343 423.334 Tm (promote) Tj -1 0 0 1 349.695 423.334 Tm (its) Tj -1 0 0 1 365.031 423.334 Tm (widespread) Tj -1 0 0 1 429.723 423.334 Tm (deployment.) Tj -1 0 0 1 70.875 409.234 Tm (This) Tj -1 0 0 1 96.879 409.234 Tm (enhances) Tj -1 0 0 1 152.247 409.234 Tm (the) Tj -1 0 0 1 172.263 409.234 Tm (functionality) Tj -1 0 0 1 238.959 409.234 Tm (and) Tj -1 0 0 1 262.311 409.234 Tm (interoperability) Tj -1 0 0 1 343.671 409.234 Tm (of) Tj -1 0 0 1 357.015 409.234 Tm (the) Tj -1 0 0 1 377.031 409.234 Tm (Web.) Tj -1 0 0 1 70.875 392.134 Tm (This) Tj -1 0 0 1 96.879 392.134 Tm (document) Tj -1 0 0 1 152.907 392.134 Tm (specifies) Tj -1 0 0 1 202.923 392.134 Tm (a) Tj -1 0 0 1 212.931 392.134 Tm (syntax) Tj -1 0 0 1 250.947 392.134 Tm (created) Tj -1 0 0 1 294.303 392.134 Tm (by) Tj -1 0 0 1 310.311 392.134 Tm (subsetting) Tj -1 0 0 1 368.343 392.134 Tm (an) Tj -1 0 0 1 385.023 392.134 Tm (existing,) Tj -1 0 0 1 432.375 392.134 Tm (widely) Tj -1 0 0 1 469.047 392.134 Tm (used) Tj -1 0 0 1 70.875 378.034 Tm (international) Tj -1 0 0 1 139.575 378.034 Tm (text) Tj -1 0 0 1 162.255 378.034 Tm (processing) Tj -1 0 0 1 223.611 378.034 Tm (standard) Tj -1 0 0 1 273.639 378.034 Tm (\(Standard) Tj -1 0 0 1 329.667 378.034 Tm (Generalized) Tj -1 0 0 1 397.695 378.034 Tm (Markup) Tj -1 0 0 1 441.039 378.034 Tm (Language,) Tj -1 0 0 1 70.875 363.934 Tm (ISO) Tj -1 0 0 1 94.887 363.934 Tm (8879:1986\(E\)) Tj -1 0 0 1 170.931 363.934 Tm (as) Tj -1 0 0 1 186.939 363.934 Tm (amended) Tj -1 0 0 1 240.303 363.934 Tm (and) Tj -1 0 0 1 263.655 363.934 Tm (corrected\)) Tj -1 0 0 1 321.003 363.934 Tm (for) Tj -1 0 0 1 338.343 363.934 Tm (use) Tj -1 0 0 1 361.023 363.934 Tm (on) Tj -1 0 0 1 377.703 363.934 Tm (the) Tj -1 0 0 1 397.719 363.934 Tm (World) Tj -1 0 0 1 432.387 363.934 Tm (Wide) Tj -1 0 0 1 463.059 363.934 Tm (Web.) Tj -1 0 0 1 494.403 363.934 Tm (It) Tj -1 0 0 1 70.875 349.834 Tm (is) Tj -1 0 0 1 82.875 349.834 Tm (a) Tj -1 0 0 1 92.883 349.834 Tm (product) Tj -1 0 0 1 136.239 349.834 Tm (of) Tj -1 0 0 1 149.583 349.834 Tm (the) Tj -1 0 0 1 169.599 349.834 Tm (W3C) Tj -1 0 0 1 199.599 349.834 Tm (XML) Tj -1 0 0 1 227.607 349.834 Tm (Activity,) Tj -1 0 0 1 272.283 349.834 Tm (details) Tj -1 0 0 1 310.299 349.834 Tm (of) Tj -1 0 0 1 323.643 349.834 Tm (which) Tj -1 0 0 1 357.651 349.834 Tm (can) Tj -1 0 0 1 380.331 349.834 Tm (be) Tj -1 0 0 1 397.011 349.834 Tm (found) Tj -1 0 0 1 430.371 349.834 Tm (at) Tj -1 0 0 1 70.875 335.734 Tm (http://www.w3.org/XML.) Tj -1 0 0 1 200.919 335.734 Tm (A) Tj -1 0 0 1 212.259 335.734 Tm (list) Tj -1 0 0 1 230.259 335.734 Tm (of) Tj -1 0 0 1 243.603 335.734 Tm (current) Tj -1 0 0 1 284.283 335.734 Tm (W3C) Tj -1 0 0 1 314.283 335.734 Tm (Recommendations) Tj -1 0 0 1 417.651 335.734 Tm (and) Tj -1 0 0 1 441.003 335.734 Tm (other) Tj -1 0 0 1 70.875 321.634 Tm (technical) Tj -1 0 0 1 121.563 321.634 Tm (documents) Tj -1 0 0 1 183.591 321.634 Tm (can) Tj -1 0 0 1 206.271 321.634 Tm (be) Tj -1 0 0 1 222.951 321.634 Tm (found) Tj -1 0 0 1 256.311 321.634 Tm (at) Tj -1 0 0 1 269.655 321.634 Tm (http://www.w3.org/TR.) Tj -1 0 0 1 70.875 763.65 Tm -/F5 10 Tf -1 0 0 1 384.025 754.82 Tm (XML) Tj -1 0 0 1 408.745 754.82 Tm (Recommendation) Tj -1 0 0 1 481.795 754.82 Tm (-) Tj -1 0 0 1 487.625 754.82 Tm (p.) Tj -1 0 0 1 497.625 754.82 Tm (1) Tj -1 0 0 1 70.875 99.225 Tm -ET - -endstream -endobj -18 0 obj -<< /Type /Page -/Parent 2 0 R -/MediaBox [ 0 0 576 792 ] -/Resources 4 0 R -/Contents 17 0 R ->> -endobj -xref -0 19 -0000000000 65535 f -0000000009 00000 n -0000000058 00000 n -0000000117 00000 n -0000000178 00000 n -0000000373 00000 n -0000000484 00000 n -0000000598 00000 n -0000000703 00000 n -0000000817 00000 n -0000000925 00000 n -0000001036 00000 n -0000001146 00000 n -0000001266 00000 n -0000001379 00000 n -0000001495 00000 n -0000001603 00000 n -0000001722 00000 n -0000010058 00000 n -trailer -<< -/Size 19 -/Root 1 0 R -/Info 3 0 R ->> -startxref -10166 -%%EOF diff --git a/docs/examples/results.html b/docs/examples/results.html new file mode 100644 index 000000000..3b9e87266 --- /dev/null +++ b/docs/examples/results.html @@ -0,0 +1,12 @@ +Test Results + +

Compare Results
+created 14.03.2000 10:36:22

+ + + + + + + +
reference filetest fileidentical?
normal.pdf normal.pdf Yes
table.pdf table.pdf Yes
list.pdf list.pdf Yes
link.pdf link.pdf Yes
border.pdf border.pdf Yes
extensive.pdf extensive.pdf No
diff --git a/docs/examples/runtests.bat b/docs/examples/runtests.bat new file mode 100755 index 000000000..87047a6fd --- /dev/null +++ b/docs/examples/runtests.bat @@ -0,0 +1,26 @@ +@echo off + +echo Fop Test +echo ---------------- + +if "%JAVA_HOME%" == "" goto error + +set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip;..\..\lib\ant.jar;..\..\lib\xml.jar;..\..\lib +set ANT_HOME=.\lib + +echo Starting Tests ... + +%JAVA_HOME%\bin\java.exe -Dant.home=%ANT_HOME% -classpath %LOCALCLASSPATH%;%CLASSPATH% org.apache.tools.ant.Main %1 %2 %3 %4 %5 + +goto end + +:error + +echo ERROR: JAVA_HOME not found in your environment. +echo Please, set the JAVA_HOME variable in your environment to match the +echo location of the Java Virtual Machine you want to use. + +:end + +rem set LOCALCLASSPATH= + diff --git a/docs/examples/table.fo b/docs/examples/table.fo deleted file mode 100644 index 5c8f46823..000000000 --- a/docs/examples/table.fo +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - FOP - p. - - - - - - - Content - - - - - - - - - - A) - - - What is FOP? - - - - - B) - - - Downloading FOP - - - - - C) - - - Running FOP - - - - - D) - - - Embedding FOP - - - - - E) - - - What's Implemented? - - - - - F) - - - Limitations - - - - - G) - - - Bugs - - - - - H) - - - Compiling FOP - - - - - I) - - - Getting involved - - - - - J) - - - FOP Relevant Specifications - - - - - K) - - - Licence - - - - - - - diff --git a/docs/examples/table.pdf b/docs/examples/table.pdf deleted file mode 100644 index 4182580c9..000000000 --- a/docs/examples/table.pdf +++ /dev/null @@ -1,203 +0,0 @@ -%PDF-1.2 -1 0 obj -<< /Type /Catalog -/Pages 2 0 R >> -endobj -2 0 obj -<< /Type /Pages -/Count 0 -/Kids [18 0 R ] >> -endobj -3 0 obj -<< /Type /Info -/Producer (FOP 0.12.1[dev]) >> -endobj -4 0 obj -<< /Font << /F11 5 0 R -/F10 6 0 R -/F9 7 0 R -/F8 8 0 R -/F7 9 0 R -/F6 10 0 R -/F5 11 0 R -/F4 12 0 R -/F3 13 0 R -/F2 14 0 R -/F1 15 0 R -/F12 16 0 R ->> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -5 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F11 -/BaseFont /Courier-Bold -/Encoding /WinAnsiEncoding >> -endobj -6 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F10 -/BaseFont /Courier-Oblique -/Encoding /WinAnsiEncoding >> -endobj -7 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F9 -/BaseFont /Courier -/Encoding /WinAnsiEncoding >> -endobj -8 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F8 -/BaseFont /Times-BoldItalic -/Encoding /WinAnsiEncoding >> -endobj -9 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F7 -/BaseFont /Times-Bold -/Encoding /WinAnsiEncoding >> -endobj -10 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F6 -/BaseFont /Times-Italic -/Encoding /WinAnsiEncoding >> -endobj -11 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -12 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F4 -/BaseFont /Helvetica-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -13 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F3 -/BaseFont /Helvetica-Bold -/Encoding /WinAnsiEncoding >> -endobj -14 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F2 -/BaseFont /Helvetica-Oblique -/Encoding /WinAnsiEncoding >> -endobj -15 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -16 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F12 -/BaseFont /Courier-BoldOblique -/Encoding /WinAnsiEncoding >> -endobj -17 0 obj -<< /Length 1457 >> -stream -BT -1 0 0 1 70.875 678.6 Tm -/F3 10 Tf -1 0 0 1 85.875 671.42 Tm (Content) Tj -/F1 10 Tf -1 0 0 1 86.445 658.17 Tm (A\)) Tj -1 0 0 1 99.225 658.17 Tm (What) Tj -1 0 0 1 125.345 658.17 Tm (is) Tj -1 0 0 1 135.345 658.17 Tm (FOP?) Tj -1 0 0 1 86.445 646.92 Tm (B\)) Tj -1 0 0 1 99.225 646.92 Tm (Downloading) Tj -1 0 0 1 159.805 646.92 Tm (FOP) Tj -1 0 0 1 85.895 635.67 Tm (C\)) Tj -1 0 0 1 99.225 635.67 Tm (Running) Tj -1 0 0 1 139.245 635.67 Tm (FOP) Tj -1 0 0 1 85.895 624.42 Tm (D\)) Tj -1 0 0 1 99.225 624.42 Tm (Embedding) Tj -1 0 0 1 152.585 624.42 Tm (FOP) Tj -1 0 0 1 86.445 613.17 Tm (E\)) Tj -1 0 0 1 99.225 613.17 Tm (What's) Tj -1 0 0 1 132.255 613.17 Tm (Implemented?) Tj -1 0 0 1 87.005 601.92 Tm (F\)) Tj -1 0 0 1 99.225 601.92 Tm (Limitations) Tj -1 0 0 1 85.335 590.67 Tm (G\)) Tj -1 0 0 1 99.225 590.67 Tm (Bugs) Tj -1 0 0 1 85.895 579.42 Tm (H\)) Tj -1 0 0 1 99.225 579.42 Tm (Compiling) Tj -1 0 0 1 146.455 579.42 Tm (FOP) Tj -1 0 0 1 90.335 568.17 Tm (I\)) Tj -1 0 0 1 99.225 568.17 Tm (Getting) Tj -1 0 0 1 134.245 568.17 Tm (involved) Tj -1 0 0 1 88.115 556.92 Tm (J\)) Tj -1 0 0 1 99.225 556.92 Tm (FOP) Tj -1 0 0 1 122.565 556.92 Tm (Relevant) Tj -1 0 0 1 164.805 556.92 Tm (Specifications) Tj -1 0 0 1 86.445 545.67 Tm (K\)) Tj -1 0 0 1 99.225 545.67 Tm (Licence) Tj -1 0 0 1 70.875 763.65 Tm -/F5 10 Tf -1 0 0 1 460.955 754.82 Tm (FOP) Tj -1 0 0 1 481.795 754.82 Tm (-) Tj -1 0 0 1 487.625 754.82 Tm (p.) Tj -1 0 0 1 497.625 754.82 Tm (1) Tj -1 0 0 1 70.875 99.225 Tm -ET - -endstream -endobj -18 0 obj -<< /Type /Page -/Parent 2 0 R -/MediaBox [ 0 0 576 792 ] -/Resources 4 0 R -/Contents 17 0 R ->> -endobj -xref -0 19 -0000000000 65535 f -0000000009 00000 n -0000000058 00000 n -0000000117 00000 n -0000000178 00000 n -0000000373 00000 n -0000000484 00000 n -0000000598 00000 n -0000000703 00000 n -0000000817 00000 n -0000000925 00000 n -0000001036 00000 n -0000001146 00000 n -0000001266 00000 n -0000001379 00000 n -0000001495 00000 n -0000001603 00000 n -0000001722 00000 n -0000003231 00000 n -trailer -<< -/Size 19 -/Root 1 0 R -/Info 3 0 R ->> -startxref -3339 -%%EOF diff --git a/lib/Compare.class b/lib/Compare.class new file mode 100644 index 0000000000000000000000000000000000000000..714ffface1a98cacca8586fc622b88a1e4255d20 GIT binary patch literal 5086 zcmb_g33yc175?vJ!aT+ia7=)(=zzlYxf} zyxG9p4U8Fh+`#({e89l(19)oy&j#?-0KOK$*8})Q0N)JYTLC;5z_$bVP5|Ex;Clgl zKY$+u@WTLp6u>Woh~TOq&KFXT%|XmXcMx^BI*7B;6T}>B31Xg*g+ijZW-4amS|Kl! z8CylLO~`dY@=PJUB1i?X0O_eX2bNgrlNtRY9SGt)WQ1HVg6(27E2BYC$;qoNqam4l zLl9@dkyuFTkQaeFmCD27V~4!%6z98wI9JF5>=qw;LO6m$LT(juyO383xkJc3LS7TX zJMlyaCxkqSSBLNv?hr?N@Cm#(gr{*!2%o}u2%iz@XK`N$ zpTlh-d>$_k;R_=DF%E|CQydH7XTtl1jD96^e=UB0g99P_7LSDR2O)o!*T2ZSYdi3ZCm+V)QwoXGI@7_f-g!#RrQNnHC?YzQ@^O~ zdUJ=F$eOwS#3t9tFMT)L4 zMN2ocl5LM^v#)J7os2A~u&Qu-N7pGE5!_@CJ1I-np)j}0%x{kr0oNEQ?5GF@jT5Dg zV>`2A)&^;@oVcX8U9%ey8^g1*RYr(K29 z2h98i+p%=QXhmgcwS;;eG8u+lm9eQhSD!6B6()fkV=YQs7zR^O`C5TZ!l6>);fi4v znHA`);8tLBBDZK^hPF^~U?^0uytFFJENgizZ!IV5?#{c`V9}4Z*frqTJH5)Q(H170 znk+cYF12lix-w%zNfez`6a*8-ME46A0y%4^w}l~&B&T}!n3Wt)YMmx3+1YeKiK7ao zb8M$SVGfz80W0C!b~c|db1oB>$)-zH&wSd$#7JOB4&!W&rv;0i_zstv=Gu&-3w1ZO z9IvZ0!-dgeY3z(AZ?Wr}EN6=HmMifHRtch7zIGNHaD}ZIM(~DgUPWAH~I0k7B83^4(-j<5vL?h976r z?KC{bHy?kB*Vf|n1mDC!b!-f=^3*As=}ifF3ivDDr48^_OAdXj1g7vma3D60x}I^& z?TL?}aSV%3U|osTP-L}KHB~M1`H{S2RZW7%Tj!a39P2A`S>y(rqm~21K#Fg z3w0zvHStk2H}H4gVQ=-aTJpVhcsXoE2LV`$NA18JYAtQ(}jB2%6e!T zL9Do0XO=TgiAF_rajVx?9b@Jv(H0C9F;S`QFIUzQ))a6hYrB&jViWhaixG9A0avkh zH?w-X*$b{F?Pjg^;96W$QGHuW)wi`&eOpV__dMR4Fw!Dyi9PBoyG16MZc%;M` zcZ{4y_PNFELQx%K%=1}_F$p*#n69naJIGPz?paK$nIHbTnoi2E6|bm3%m_2XDQj`MrQK$u;=As(L2 zvW literal 0 HcmV?d00001 diff --git a/lib/Compare.java b/lib/Compare.java new file mode 100644 index 000000000..66e02005d --- /dev/null +++ b/lib/Compare.java @@ -0,0 +1,146 @@ +/* +// header - edit "Data/yourJavaHeader" to customize +// contents - edit "EventHandlers/Java file/onCreate" to customize +// +*/ + +import java.util.*; +import java.io.*; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.BuildException; +import java.text.DateFormat; + + +public class Compare { + private String referenceDirectory, testDirectory; + private String [] filenameList; + private String filenames; + private static boolean IDENTICAL_FILES = true; + private static boolean NOTIDENTICAL_FILES = false; + private BufferedInputStream oldfileInput; + private BufferedInputStream newfileInput; + + //sets directory for test files + public void setTestDirectory(String testDirectory) { + if (!(testDirectory.endsWith("/") | testDirectory.endsWith("\\"))) { + testDirectory += File.separator; + } + this.testDirectory = testDirectory; + } + + //sets directory for reference files + public void setReferenceDirectory(String referenceDirectory) { + if (!(referenceDirectory.endsWith("/") | referenceDirectory.endsWith("\\"))) { + referenceDirectory += File.separator; + } + this.referenceDirectory = referenceDirectory; + } + + public void setFilenames (String filenames) { + StringTokenizer tokens = new StringTokenizer(filenames,","); + Vector filenameListTmp = new Vector(20); + while (tokens.hasMoreTokens()) { + filenameListTmp.add(tokens.nextToken()); + } + filenameList = new String [filenameListTmp.size()] ; + filenameListTmp.copyInto((String[]) filenameList); + } + + private boolean compareBytes (File oldFile, File newFile) { + try { + oldfileInput = new BufferedInputStream(new FileInputStream(oldFile)); + newfileInput = new BufferedInputStream(new FileInputStream(newFile)); + int charactO = 0; + int charactN = 0; + boolean identical = true; + + while (identical & (charactO != -1)) { + if (charactO == charactN) { + charactO = oldfileInput.read(); + charactN = newfileInput.read(); + } else { + return NOTIDENTICAL_FILES; + } + } + return IDENTICAL_FILES; + } catch (IOException io) { + System.err.println("Task Compare - Error: \n" + io.toString()); + } + return NOTIDENTICAL_FILES; + } + + private boolean compareFileSize(File oldFile, File newFile) { + if (oldFile.length() != newFile.length()) { + return NOTIDENTICAL_FILES; + } else { + return IDENTICAL_FILES; + } + } //end: compareBytes + + private boolean filesExist (File oldFile, File newFile) { + if (!oldFile.exists()) { + System.err.println("Task Compare - ERROR: File " + + referenceDirectory + oldFile.getName() + + " doesn't exist!"); + return false; + } else if (!newFile.exists()) { + System.err.println("Task Compare - ERROR: File " + + testDirectory + newFile.getName() + " doesn't exist!"); + return false; + } else { + return true; + } + } + + public void writeHeader (PrintWriter results) { + String dateTime = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM).format(new Date()); + results.println("Test Results\n"); + results.println("

Compare Results
"); + results.println("created " + dateTime + "

"); + results.println("" + + ""); + + + } + + //main method of task compare + public void execute () throws BuildException { + boolean identical = false; + File oldFile; + File newFile; + try { + PrintWriter results = new PrintWriter (new FileWriter("results.html"),true); + this.writeHeader(results); + for (int i = 0; i < filenameList.length; i++) { + oldFile = new File (referenceDirectory + filenameList[i]); + newFile = new File (testDirectory + filenameList[i]); + if (filesExist(oldFile, newFile)) { + identical = compareFileSize(oldFile, newFile); + if (identical) { + identical = compareBytes(oldFile,newFile); + } + if (!identical) { + System.out.println("Task Compare: \nFiles " + referenceDirectory + + oldFile.getName()+ " - " + testDirectory + + newFile.getName() + " are *not* identical."); + results.println(""); + } else { + results.println(""); + } + } + } + results.println("
reference filetest fileidentical?
" + + oldFile.getName() + " " + + newFile.getName() +"" + + " No
" + + oldFile.getName() + " " + + newFile.getName() + "" + + " Yes
"); + } catch (IOException ioe) { + System.err.println("ERROR: " + ioe); + } + } //end: execute() +} + diff --git a/lib/Fop.class b/lib/Fop.class new file mode 100644 index 0000000000000000000000000000000000000000..b4c5951168d0b51ab91198fe4be0512bd6e5aa72 GIT binary patch literal 4214 zcma)9dvp|M75`1LWG2f(V9WdEwgH-iWS2f^DPTiLAdnYH2n73@>`sz_&CYgaHU!&R zANZ)&s;$hD$#_$YH&5=G>mIFrr`k%Z_)5J4G(H~NW=RyykElyG@RA&84cgm@GTAB z*6xDE5sl!3R9TMK4><))f ziRxpDGH9riKAhx zL|RUai8LcSOGsAi-YIU7)WR0xMDS+ZE#x&q?i2E+2tFjc599R_oWlJPd<3tI;G?)J zf=}RN1fRw|5uC=WB6tFCh#-&mL@I@A z!O!KyFT}<#<;1UWZv?-^8zcA~ULC<7rFAVqoq@wGyE>lnWeA{u5?F@|3je< z+?g95_JY(@79NaednTK6`>dRuH0a0Da(IT}$};>w5{n)adE@_uEPr-$UAa`x;sxE6 z{8Vi-Gp4(PIow|UFRWl~dCB&0zwR7mS%zAyl)>6=v2y8@U&+a&;W!l4%rDj9Yi6f78JaEy zAIOM5G7gfwEe1|TM%L?T<}iS7YwmCED4I~9u*(aOTn>kaB2_u>J-H0h`TJe&B|p`0Z2e+tAw~{dv*cOQq`VL8zXwU z*=xUms(`ijQqwUI0mz~mhx|v1f&j}OQ0(3rRB%$x#vXTEV{DeU{iC*Z%x~9qo`#I! zCOY*rQ#xj(4)k^e9Pv{l0P>lC7Q%?6c7Db<<~yHcZtFOM<9;W`*@^tc`#4Nex_wEB zZT<$T!HU)5QP;B4PJ)v&u~T|B5WD4qDn99Fb(Hv1k`$e+ zv~ujCD&Kv!lfUr_*zdGZ*6S*ju_`oSR-W%^c2JccMz+0eWYfCjq}nl9#6B?0eNXY! zd|u4NSzyJ!3Av*t=Y-~3#R`k%GR8!fuQWy~_97LsI47?~fyu|GhdQpOb4K^D?EEIj z<$Qm<0zd_Se61seysVK{L6J8_(zo&|!BycpuVE7LGu%|*kpc)*@m}sDJ^;VRJ9(wa z>!W{I*@%!Qdn9_<6k7K+oJUnOy6-HuO=JCFbm=6nZOG$>JbLoj*D!_VJoY?;rqc(D z2yGVP6!w=S)pI0UN)mOBWNlGG1AUZ5D@rDn)AX+vasIFM);$c1Tn{1Ut#@Nh;ePib z%6qG4a2gQCCM@7*NiBm@i_OGe#og6tCEbH-(2i?yJNHAl4oO^(9@|f%Hngo6%do_yaIUg+U zLNA27tK>mw3Oi1rlJ^;%M+eTZVD7^6xPX@wLO;&r00((>h@lx|(H&;M2N~pB81h@O z8@IuL4wJziLkc-w9m6QKnEV~V2^_`!NaG<&Pa=aeuy77pJc~PN$D}127vZpcU4Dj` z_#03E69ZnFcF-bIQ7G*S`~#oF2kBuI{*J#ebrr-vfS=$oey5(GCm+M3EUAkuqmSd= z+`XNrr3E&zN%#fDo%Gbdp^^*OUb>j8j!k*AbVe7lNxGVz!}6v)c84BEO=A-?wRKS< zkIqh}VfUlBywT@8hUHQgixN}lEmQ_8pmQ3H%uC&1bb-=1iR<&&KZ)y3ADqUz!RV4n zT=O(N*pCtZUs;Im4%E<-HdNF5g)HACEZ-RR@-ucHwxfgSPX4+W>u$!n3wLl$avdRe z6un-Q8vMJ#lU^||WDb7j#ip9kIg5AE<`U-U40)B@{~Grd;;@50$o#2l*z_cBo*6D- ukGqO(u+r1N%tsZnAQMU^mdvH!l-IR)uC8^|wf04H$ 0 && path.charAt(0) != '/') + path = '/' + path; + try { + return new InputSource(new URL("file", null, + path).toString()); + } + catch (java.net.MalformedURLException e) { + throw new Error("unexpected MalformedURLException"); + } + } + + public void execute () throws BuildException { + boolean errors = false; + String version = Version.getVersion(); + System.out.println("=======================\nTask " + version + + "\nconverting file " + fofile + " to " + pdffile); + + if (!(new File(fofile).exists())) { + errors = true; + System.err.println("Task Fop - ERROR: Formatting objects file " + fofile + " missing."); + } + + Parser parser = createParser(); + + if (parser == null) { + System.err.println("Task Fop - ERROR: Unable to create SAX parser"); + errors = true; + } + + if (!errors) { + try { + Driver driver = new Driver(); + driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version); + driver.addElementMapping("org.apache.fop.fo.StandardElementMapping"); + driver.addElementMapping("org.apache.fop.svg.SVGElementMapping"); + driver.setWriter(new PrintWriter(new FileWriter(pdffile))); + driver.buildFOTree(parser, fileInputSource(fofile)); + driver.format(); + driver.render(); + } catch (Exception e) { + System.err.println("Task Fop - FATAL ERROR: " + e.getMessage()); + System.exit(1); + } + } + System.out.println("=======================\n"); + } +} + diff --git a/lib/Xslt.class b/lib/Xslt.class index 2c24a38cdec224721b6d48b001a34eb3e3560337..63a56aa9ffb25065e236ec989699cf13e9a2a0d7 100644 GIT binary patch literal 3929 zcmbtXYj9gf75>(eb+2V5PL)TaBo4}}vgLA(y#@B|{EF zW_0%KIp6M{J$ugCy+3;AjW-cM6W%m&)Wo2Pw25OTPMY|ziI181xQS1g_@s$XnfSDc z&zN}L#0w^_nwT*0T?3yr@VJ4m8aQX*yn!bSJZa!515X=x(ZEXvUN&&Sz}F1CV&K&< z=3-|UwL<3Mt}qq~St?|ikj2;~vfV=N7I1qN$(}H7#oj8!&>^yYGWG*u#L+1ux&+cK zvi;J%M{pk$*?}+?pr;z|!M!rq8}LZGgGx5B)-`u1bi2`iPc?4zkJFPpZHZd6E6 z>|~FotYNEfP^U&Ls#7Cw#!DUOYVY2cb^5gHI$0t)%{@N7S0P%LpDXR8+R_=lad$n1 z&E>+Wn5jJ(&{!DYTh!5eO!s*kryIF7H!z^ZfcZ1Q%cm)9?A=aNgmY(!(&-EG=^hgw zYaz`dgK2O>(p*8<8@ovqnduD-3#gt&TN!wWPII`w$t7w zg(Y|1@w6ScJO*rU&eQQkzaG|hzqY+ZYdG%z1~`z} zuyWeSBEa`+ya21eA*@UC${p0&D`M}Sj*V~0WSj?dfBb}%$uao`oNU}1)Fl?WLsr&{ zTUpvVs@+7KfQ0QN=-JZQc6H=;SF}-~wp87<<-kq#`#amq^}z#lnnIN{&64U0is=!u zhQ(nDw-i0sm)7pKLEU$p;G&EJL;C)lmEmy)bT+GC=n>sVkBdTz3l$MY(qu_cm^Em* zdz`H9c8+TagHYNQ9~0*nnnH0X?k05@|_ExFSFk`WdFM?VCAymk%POd_3a=+zW z?6NwB`z$l7TDOc8MB=kBT0Z zq&*1YAi_9=Ik*q=*{_hdM`5n>)EYz`p1|UsE5Y>*k=cmBWE0v9K3 zO41VG=cvIi5XCR~-1-$(;%zkI*I0|+U_E||Zt4!5Nk z9KSg_dkoFzP@N3Y-xsjgmqmS9YckoeAlTS6jxE$t(G;zrB6x=Ew!kwm0v8YrK6DN- zA2^Oie~N0Z8x7NC^Fsop-r(VGy?&Oxd{+X0W+eQD++XRlzafdg^Y#4?wBVoU#J{kg z`~mzMNAMr|>>Zp^6?j+$@EF^(suItt5MEOz-cnWgDf>TDv+%a6!SB@^`~iQ$LtG(9 zuP;Frp2cV(LVEeeub`%R0&{!Dv7)^p8CX4rI~tNfHt%mpRoUMShXkiI@o*q1)a zn0|yvzIJEAx0K^G@%=>dVLTIleK|fyyhkM8&@w`an)mE(tq&u}Mv zlo#+vC<$@DDY}ixm556gtvUNdAyf*vR_vZ)WCSk;FP5a#Qa>@iPx=F<{135;Z9U#X z1Aff#_z4%|er&nEAK;=ouiRv8P$jB98OGNg)yb}eR+f0~Q1j;J6YWws#=j+pbPJi7!fBp01DeAEc z_cR>Sa9qQO8U{3+(=e>zV+{ojUud|i;-U(nVpPSLig6XTiU}20RJbZU6-5YuaBOzGAOh-wQ1=pUIAwq~GHf zOW}Z5@^hl=|HICTpyY&umOmy~EzaF|z;^BMkb(^dU-DCsIOgSrg2N|#-}AHSBaY); z7y0xx%PENFL=R`5IJvX4z z)1R(HRIsYocE#yZVMO?Y)`-K|TH^}Zo_U5;30Xv86}Xql=PRqAdEm&%|Gbd>ENq{Cq47AZ-) z?T$us7!k3#)OgC(3u;gQV!{d*tyTFbXsJCD3f9(|Vje$>oeV-zP_QY&x*|0DEQdQ$ z5P9ZXHLKxRLD=Wz?NM7W$2!+ju&wIAg`VdGrsam_(UR@tt45}lMGacP6$NcozM3Oj z#o1?Ps=-y&G4tYRi>PiZ7kd7rg6%H`R});pIteTn95b-WCizj7T0Ji*ZZO+;|J0(S znB&q`jBgxLBoJXwWq)<{`xn3(l>y0ca*JKbq&P}L#CruRgOJ`q-*N-FBfJYkFTMj9 zHC!_5@|sKQwj14-Qi zl+Bqrtj{F1N9cS&Rl#|-EBSl@gA95eI;8@O1M8xJf1{B-;BMw2I+NNgwoE~1ke$=; zBa8K2$C`sX8d0GBh|kT(9!cw=@?<8. */ - + //package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.Task; import java.net.*; import java.io.*; +import java.util.*; import org.apache.xalan.xslt.*; /** @@ -70,142 +71,219 @@ import org.apache.xalan.xslt.*; *
  • xsltfile *
  • outfile *
  • smart + *
  • dependent * *

    * Of these arguments, infile, outfile and xsltfile are required. - * smart defaults to 'no'. The other allowed value is 'yes'. If smart is set to 'yes' + *

    smart defaults to 'no'. The other allowed value is 'yes'. If smart is set to 'yes' * xalan is only called if either the outfile is older than the infile or the stylesheet - * or the outfile doesn't exist. + * or the outfile doesn't exist. + *

    dependent defaults to 'none'. Other possible values: a comma delimited list of file names + * which date is checked against the output file. This way you can name files which, if + * they have been modified, initiate a restart of the xslt process, like external entities etc. *

    * @author Fotis Jannidis fotis@jannidis.de */ public class Xslt extends Task { - private String infile, outfile, xsltfile; - private String smart = "no"; //defaults to do conversion everytime task is called + private String infile, outfile, xsltfile; + private String smart = "no"; //defaults to do conversion everytime task is called + private String dependent = "none"; //defaults to no dependencies + private boolean startXslt = false; - /** - * Calls Xalan and does the transformation - * - */ + /** + * Sets the input file + * + */ + public void setInfile (String infile) { + this.infile = infile; + } - private void transform(String xmlSourceURL, String xslURL, String outputURL) - throws java.io.IOException, - java.net.MalformedURLException, - org.xml.sax.SAXException { - - // Use XSLTProcessor to instantiate an XSLTProcessor. - org.apache.xalan.xslt.XSLTProcessor processor = - org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(); - - // Create the 3 objects the XSLTProcessor needs to perform the transformation. - org.apache.xalan.xslt.XSLTInputSource xmlSource = - new org.apache.xalan.xslt.XSLTInputSource (infile); - org.apache.xalan.xslt.XSLTInputSource xslSheet = - new org.apache.xalan.xslt.XSLTInputSource (xsltfile); - org.apache.xalan.xslt.XSLTResultTarget xmlResult = - new org.apache.xalan.xslt.XSLTResultTarget (outfile); - - // Perform the transformation. - System.out.println("============================"); - System.out.println("xslt \nin: " + infile + "\nstyle: " + xsltfile + "\nout: " + outfile); - System.out.println("============================"); - processor.process(xmlSource, xslSheet, xmlResult); + /** + * Sets the stylesheet file + * + */ + public void setXsltfile (String xsltfile) { + this.xsltfile = xsltfile; + } + + /** + * Sets the output file + * + */ + public void setOutfile (String outfile) { + this.outfile = outfile; + } + + /** + * Sets the value for smart + * + * @param option valid values: + *

      + *
    • yes: check whether output file is older than input or stylesheet + *
    • no: (default) do conversion everytime task is called + *
    + */ + public void setSmart (String smart) { + this.smart = smart; + } + +/** + * Sets the value for dependent + * + * @param option valid values: + *
      + *
    • none: (default) + *
    • comma delimited list of files whose existence and date is checked + * against the output file + *
    + */ + public void setDependent (String dependent) { + this.dependent = dependent; + } + + /** + * Calls Xalan and does the transformation + * + */ + private void transform(String xmlSourceURL, String xslURL, String outputURL) + throws java.io.IOException, + java.net.MalformedURLException, + org.xml.sax.SAXException + { + // Use XSLTProcessor to instantiate an XSLTProcessor. + org.apache.xalan.xslt.XSLTProcessor processor = + org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(); + + // Create the 3 objects the XSLTProcessor needs to perform the transformation. + org.apache.xalan.xslt.XSLTInputSource xmlSource = + new org.apache.xalan.xslt.XSLTInputSource (infile); + org.apache.xalan.xslt.XSLTInputSource xslSheet = + new org.apache.xalan.xslt.XSLTInputSource (xsltfile); + org.apache.xalan.xslt.XSLTResultTarget xmlResult = + new org.apache.xalan.xslt.XSLTResultTarget (outfile); + // Perform the transformation. + System.out.println("============================"); + System.out.println("xslt \nin: " + infile + "\nstyle: " + xsltfile + "\nout: " + outfile); + System.out.println("============================"); + processor.process(xmlSource, xslSheet, xmlResult); + } //end transform + + /** + * Catches the errors transform() can throw and + * returns meaningfull error messages + */ + private void startTransform () { + try { + transform (infile,xsltfile,outfile); + } catch (org.xml.sax.SAXException saxerror) { + System.out.println("Task xslt - SAX ERROR:\n " + saxerror); + } catch (MalformedURLException urlerror) { + System.out.println("Task xslt - URL ERROR:\n " + urlerror); + } catch (IOException ioerror) { + System.out.println("Task xslt - IO ERROR:\n " + ioerror); + } + } //end startTransform + + /** + * Checks for existence of output file and compares + * dates with input and stylesheet file + */ + private boolean smartCheck (File outfileF, long outfileLastModified, File infileF, File xsltfileF) { + + if (outfileF.exists()) { + //checks whether output file is older than input file or xslt stylesheet file + if ((outfileLastModified < infileF.lastModified()) | + (outfileLastModified < xsltfileF.lastModified())) { + return true; + } + } else { + //if output file does not exist, start xslt process + return true; + } + return false; + } //end smartCheck + + /** + * Checks for existence and date of dependent files + * This could be folded together with smartCheck by using + * a general routine but it wouldn't be as fast as now + */ + private boolean dependenciesCheck(File outfileF, long outfileLastModified) { + String dependentFileName; + File dependentFile; + StringTokenizer tokens = new StringTokenizer(dependent,","); + while (tokens.hasMoreTokens()) { + dependentFileName = (String) tokens.nextToken(); + dependentFile = new File (dependentFileName); + //check: does dependent file exist + if (dependentFile.exists()) { + //check dates + if ((outfileLastModified < dependentFile.lastModified()) ) { + return true; } - - /** - * Sets the input file - * - */ - public void setInfile (String infile) { - this.infile = infile; - } + } else { + System.err.println("Task xslt - ERROR in attribute 'dependent':\n file " + dependentFileName + " does not exist."); + } + } + return false; + } //end dependenciesCheck + +/** + * Main method, which is called by ant. + * Checks for the value of smart and calls startTransform accordingly + */ + public void execute () throws org.apache.tools.ant.BuildException { + + File outfileF = new File (outfile); + File infileF = new File(infile); + File xsltfileF = new File (xsltfile); + long outfileLastModified = outfileF.lastModified(); + boolean startFileExist = true; - /** - * Sets the stylesheet file - * - */ - public void setXsltfile (String xsltfile) { - this.xsltfile = xsltfile; - } - - /** - * Sets the output file - * - */ - public void setOutfile (String outfile) { - this.outfile = outfile; - } - - /** - * Sets the value for smart - * - * @param option valid values: - *
      - *
    • yes: check whether output file is older than input or stylesheet - *
    • no: (default) do conversion everytime task is called - *
    - */ - public void setSmart (String smart) { - this.smart = smart; - } - + //checks whether input and stylesheet exist. + //this could be left to the parser, but this solution does make problems if smart is set to yes + if (!infileF.exists()) { + System.err.println("Task xslt - ERROR:\n Input file " + infile + " does not exist!"); + startFileExist = false; + } else if (!xsltfileF.exists()) { + System.err.println("Task xslt - ERROR:\n Stylesheet file " + xsltfile + " does not exist!"); + startFileExist = false; + } - /** - * Catches the errors transform() can throw and - * returns meaningfull error messages - */ - private void startTransform () { - try { - transform (infile,xsltfile,outfile); - } catch (org.xml.sax.SAXException saxerror) { - System.out.println("SAX Error: " + saxerror); - } catch (MalformedURLException urlerror) { - System.out.println("URL Error: " + urlerror); - } catch (IOException ioerror) { - System.out.println("IO Error: " + ioerror); - } - } - - /** - * Main method, which is called by ant. - * Checks for the value of smart and calls startTransform accordingly - */ - public void execute () throws org.apache.tools.ant.BuildException { - if (smart.equals("no")) { - startTransform(); - } else if (smart.equals("yes")) { - File outfileF = new File (outfile); - //checks for existence of output file - if (outfileF.exists()) { - //checks whether output file is older than input file or xslt stylesheet file - if ((outfileF.lastModified() < new File(infile).lastModified()) | (outfileF.lastModified() < new -File(xsltfile).lastModified())) { - startTransform(); - } - } else { - startTransform(); - } - //returns error message, if smart has another value as 'yes' or 'no' - } else { - System.err.println("Error: Allowed values for the attribute smart are 'yes' or 'no'"); - } - - } - //quick access for debugging - //usage XSLT infile xsltfile outfile (smart is 'yes') - /* - public static void main (String args[]) { - Xslt xslt = new Xslt(); - xslt.setInfile(args[0]); - xslt.setXsltfile(args[1]); - xslt.setOutfile(args[2]); - xslt.setSmart("yes"); - xslt.execute(); - } - */ - + //checks attribute 'smart' + if (smart.equals("no")) { + startXslt = true; + //if attribute smart = 'yes' + } else if (smart.equals("yes")) { + startXslt = smartCheck (outfileF,outfileLastModified,infileF,xsltfileF); + //checks dependent files against output file, makes only sense if smartCheck returns false + if (!dependent.equals("none") & (startXslt == false)) { + startXslt = dependenciesCheck(outfileF,outfileLastModified); + } + //returns error message, if smart has another value as 'yes' or 'no' + } else { + System.err.println("Task xslt - ERROR: Allowed values for the attribute smart are 'yes' or 'no'"); + } + if (startFileExist & startXslt) { + startTransform(); + } + } //end execute + + //quick access for debugging + //usage XSLT infile xsltfile outfile (smart is 'yes') + /* + public static void main (String args[]) { + Xslt xslt = new Xslt(); + xslt.setInfile(args[0]); + xslt.setXsltfile(args[1]); + xslt.setOutfile(args[2]); + xslt.setSmart("yes"); + xslt.setDependent("test1,test2"); + xslt.execute(); + } */ + } -- 2.39.5