git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193299 13f79535-47bb-0310-9956-ffa450edef68tags/pre-columns
@@ -0,0 +1,95 @@ | |||
<?xml version="1.0"?> | |||
<!-- =========================================================================== --> | |||
<project default="runtest" basedir="."> | |||
<!-- =================================================================== --> | |||
<!-- Initialization target --> | |||
<!-- =================================================================== --> | |||
<target name="init"> | |||
<tstamp/> | |||
<mkdir dir="tests"/> | |||
<property name="referenceDir" value="reference"/> | |||
<property name="testDir" value="tests"/> | |||
<property name="foDir" value="fo"/> | |||
<taskdef name="fop" classname="Fop"/> | |||
<taskdef name="compare" classname="Compare"/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Help on usage --> | |||
<!-- =================================================================== --> | |||
<target name="usage"> | |||
<echo message=""/> | |||
<echo message=""/> | |||
<echo message="USAGE of runtests"/> | |||
<echo message="-------------------------------------------------------------"/> | |||
<echo message=""/> | |||
<echo message=" available targets are:"/> | |||
<echo message=""/> | |||
<echo message=" compare --> generates new pdf test files and compares them to reference files (default)"/> | |||
<echo message=" reference --> generates new reference pdf files"/> | |||
<echo message=" See the comments inside the build.xml file for more details."/> | |||
<echo message="-------------------------------------------------------------"/> | |||
<echo message=""/> | |||
<echo message=""/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Produces new test pdf files --> | |||
<!-- =================================================================== --> | |||
<target name="creating new test pdf files" depends="init"> | |||
<fop fofile="${foDir}/normal.fo" pdffile="${testDir}/normal.pdf"/> | |||
<fop fofile="${foDir}/table.fo" pdffile="${testDir}/table.pdf"/> | |||
<fop fofile="${foDir}/list.fo" pdffile="${testDir}/list.pdf"/> | |||
<fop fofile="${foDir}/link.fo" pdffile="${testDir}/link.pdf"/> | |||
<fop fofile="${foDir}/border.fo" pdffile="${testDir}/border.pdf"/> | |||
<fop fofile="${foDir}/extensive.fo" pdffile="${testDir}/extensive.pdf"/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Compares new test pdf files to reference pdf files --> | |||
<!-- =================================================================== --> | |||
<target name="compare" depends ="creating new test pdf files"> | |||
<compare referenceDirectory = "${referenceDir}" | |||
testDirectory = "${testDir}" | |||
filenames = "normal.pdf,table.pdf,list.pdf,link.pdf,border.pdf,extensive.pdf"/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Produces new reference pdf files --> | |||
<!-- =================================================================== --> | |||
<target name="reference"> | |||
<fop fofile="${foDir}/normal.fo" pdffile="${referenceDir}/normal.pdf"/> | |||
<fop fofile="${foDir}/table.fo" pdffile="${referenceDir}/table.pdf"/> | |||
<fop fofile="${foDir}/list.fo" pdffile="${referenceDir}/list.pdf"/> | |||
<fop fofile="${foDir}/link.fo" pdffile="${referenceDir}/link.pdf"/> | |||
<fop fofile="${foDir}/border.fo" pdffile="${referenceDir}/border.pdf"/> | |||
<fop fofile="${foDir}/extensive.fo" pdffile="${referenceDir}/extensive.pdf"/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Starts the test --> | |||
<!-- =================================================================== --> | |||
<target name="runtest" depends="compare"> | |||
<echo message="Running Fop tests"/> | |||
</target> | |||
<!-- =================================================================== --> | |||
<!-- Clean targets --> | |||
<!-- =================================================================== --> | |||
<target name="clean" depends="init"> | |||
<deltree dir="${build.dir}"/> | |||
</target> | |||
</project> | |||
<!-- End of file --> |
@@ -1,135 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<!-- defines the layout master --> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master page-master-name="first" | |||
height="29.7cm" width="21cm" | |||
margin-top="1cm" | |||
margin-bottom="2cm" | |||
margin-left="2.5cm" | |||
margin-right="2.5cm"> | |||
<fo:region-before extent="3cm"/> | |||
<fo:region-body margin-top="3cm"/> | |||
<fo:region-after extent="1.5cm"/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<!-- starts actual layout --> | |||
<fo:page-sequence> | |||
<!-- applies layout master --> | |||
<fo:sequence-specification> | |||
<fo:sequence-specifier-single page-master-name="first"/> | |||
</fo:sequence-specification> | |||
<!-- Inserts a header with the page number --> | |||
<fo:static-content flow-name="xsl-before"> | |||
<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt"> | |||
XSL-FO Example: simple list - p. <fo:page-number/> | |||
</fo:block> | |||
</fo:static-content> | |||
<fo:flow flow-name="xsl-body"> | |||
<!-- title --> | |||
<fo:block font-size="14pt" | |||
font-family="sans-serif" | |||
line-height="18pt" | |||
space-before.optimum="3pt" | |||
space-after.optimum="3pt" | |||
font-weight="bold" | |||
start-indent="15pt"> | |||
Validity Constraint: Standalone Document Declaration | |||
</fo:block> | |||
<!-- normal text --> | |||
<fo:block font-size="12pt" | |||
font-family="sans-serif" | |||
line-height="15pt" | |||
space-after.optimum="3pt" > | |||
The standalone document declaration must have the value "no" if | |||
any external markup declarations contain declarations of: | |||
</fo:block> | |||
<!-- list --> | |||
<fo:list-block> | |||
<!-- list item --> | |||
<fo:list-item> | |||
<!-- insert a bullet --> | |||
<fo:list-item-label> | |||
<fo:block>•</fo:block> | |||
</fo:list-item-label> | |||
<!-- list text --> | |||
<fo:list-item-body> | |||
<fo:block> | |||
attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or | |||
</fo:block> | |||
</fo:list-item-body> | |||
</fo:list-item> | |||
<!-- list item --> | |||
<fo:list-item> | |||
<!-- insert a bullet --> | |||
<fo:list-item-label> | |||
<fo:block>•</fo:block> | |||
</fo:list-item-label> | |||
<!-- list text --> | |||
<fo:list-item-body> | |||
<fo:block> | |||
entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or | |||
</fo:block> | |||
</fo:list-item-body> | |||
</fo:list-item> | |||
<!-- list entry --> | |||
<fo:list-item> | |||
<!-- insert a bullet --> | |||
<fo:list-item-label> | |||
<fo:block>•</fo:block> | |||
</fo:list-item-label> | |||
<!-- list text --> | |||
<fo:list-item-body> | |||
<fo:block> | |||
attributes with values subject to normalization, where the attribute appears in the document with a value which will | |||
</fo:block> | |||
</fo:list-item-body> | |||
</fo:list-item> | |||
<!-- list entry --> | |||
<fo:list-item> | |||
<!-- insert a bullet --> | |||
<fo:list-item-label> | |||
<fo:block>•</fo:block> | |||
</fo:list-item-label> | |||
<!-- list text --> | |||
<fo:list-item-body> | |||
<fo:block> | |||
change as a result of normalization, or | |||
</fo:block> | |||
</fo:list-item-body> | |||
</fo:list-item> | |||
<!-- list entry --> | |||
<fo:list-item> | |||
<!-- insert a bullet --> | |||
<fo:list-item-label> | |||
<fo:block>•</fo:block> | |||
</fo:list-item-label> | |||
<!-- list text --> | |||
<fo:list-item-body> | |||
<fo:block> | |||
element types with element content, if white space occurs directly within any instance of those types. | |||
</fo:block> | |||
</fo:list-item-body> | |||
</fo:list-item> | |||
</fo:list-block> | |||
<!-- end list --> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> | |||
@@ -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 |
@@ -1,128 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<!-- defines page layout --> | |||
<fo:layout-master-set> | |||
<!-- layout for the first page --> | |||
<fo:simple-page-master page-master-name="first" | |||
height="29.7cm" | |||
width="21cm" | |||
margin-top="1cm" | |||
margin-bottom="2cm" | |||
margin-left="2.5cm" | |||
margin-right="2.5cm"> | |||
<fo:region-before extent="3cm"/> | |||
<fo:region-body margin-top="3cm"/> | |||
<fo:region-after extent="1.5cm"/> | |||
</fo:simple-page-master> | |||
<!-- layout for the other pages --> | |||
<fo:simple-page-master page-master-name="rest" | |||
height="29.7cm" | |||
width="21cm" | |||
margin-top="1cm" | |||
margin-bottom="2cm" | |||
margin-left="2.5cm" | |||
margin-right="2.5cm"> | |||
<fo:region-before extent="2.5cm"/> | |||
<fo:region-body margin-top="2.5cm"/> | |||
<fo:region-after extent="1.5cm"/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<!-- end: defines page layout --> | |||
<!-- actual layout --> | |||
<fo:page-sequence> | |||
<!-- usage of page layout --> | |||
<fo:sequence-specification> | |||
<fo:sequence-specifier-repeating page-master-first="first" | |||
page-master-repeating="rest"/> | |||
</fo:sequence-specification> | |||
<!-- header --> | |||
<fo:static-content flow-name="xsl-before"> | |||
<fo:block text-align="end" | |||
font-size="10pt" | |||
font-family="serif" | |||
line-height="14pt" > | |||
XML Recommendation - p. <fo:page-number/> | |||
</fo:block> | |||
</fo:static-content> | |||
<fo:flow flow-name="xsl-body"> | |||
<!-- defines text title level 1--> | |||
<fo:block font-size="18pt" | |||
font-family="sans-serif" | |||
line-height="24pt" | |||
space-after.optimum="15pt" | |||
background-color="blue" | |||
color="white" | |||
text-align="centered" | |||
padding-top="3pt"> | |||
Extensible Markup Language (XML) 1.0 | |||
</fo:block> | |||
<!-- defines text title level 2--> | |||
<fo:block font-size="16pt" | |||
font-family="sans-serif" | |||
line-height="20pt" | |||
space-before.optimum="10pt" | |||
space-after.optimum="10pt" | |||
text-align="start" | |||
padding-top="3pt"> | |||
Abstract | |||
</fo:block> | |||
<!-- Normal text --> | |||
<fo:block font-size="12pt" | |||
font-family="sans-serif" | |||
line-height="15pt" | |||
space-after.optimum="3pt" | |||
text-align="start"> | |||
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. | |||
</fo:block> | |||
<!-- defines text title level 2--> | |||
<fo:block font-size="16pt" | |||
font-family="sans-serif" | |||
line-height="20pt" | |||
space-before.optimum="10pt" | |||
space-after.optimum="10pt" | |||
text-align="start" | |||
padding-top="3pt"> | |||
Status of this document | |||
</fo:block> | |||
<!-- Normal text --> | |||
<fo:block font-size="12pt" | |||
font-family="sans-serif" | |||
line-height="15pt" | |||
space-after.optimum="3pt" | |||
text-align="start"> | |||
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. | |||
</fo:block> | |||
<!-- Normal text --> | |||
<fo:block font-size="12pt" | |||
font-family="sans-serif" | |||
line-height="15pt" | |||
space-after.optimum="3pt" | |||
text-align="start"> | |||
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. | |||
</fo:block> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> |
@@ -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 |
@@ -0,0 +1,12 @@ | |||
<html><head><title>Test Results</title></head><body> | |||
<h2>Compare Results<br> | |||
<font size='1'>created 14.03.2000 10:36:22</font></h2> | |||
<table cellpadding='10' border='2'><thead><th align='center'>reference file</th><th align='center'>test file</th><th align='center'>identical?</th></thead> | |||
<tr><td><a href='reference\normal.pdf'>normal.pdf</a> </td><td> <a href='tests\normal.pdf'>normal.pdf</a> </td><td>Yes</td></tr> | |||
<tr><td><a href='reference\table.pdf'>table.pdf</a> </td><td> <a href='tests\table.pdf'>table.pdf</a> </td><td>Yes</td></tr> | |||
<tr><td><a href='reference\list.pdf'>list.pdf</a> </td><td> <a href='tests\list.pdf'>list.pdf</a> </td><td>Yes</td></tr> | |||
<tr><td><a href='reference\link.pdf'>link.pdf</a> </td><td> <a href='tests\link.pdf'>link.pdf</a> </td><td>Yes</td></tr> | |||
<tr><td><a href='reference\border.pdf'>border.pdf</a> </td><td> <a href='tests\border.pdf'>border.pdf</a> </td><td>Yes</td></tr> | |||
<tr><td><a href='reference\extensive.pdf'>extensive.pdf</a> </td><td> <a href='tests\extensive.pdf'>extensive.pdf</a> </td><td><font color='red'>No</font></td></tr> | |||
</table></html> |
@@ -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= | |||
@@ -1,137 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> | |||
<!-- defines the layout master --> | |||
<fo:layout-master-set> | |||
<fo:simple-page-master page-master-name="first" | |||
height="29.7cm" width="21cm" | |||
margin-top="1cm" | |||
margin-bottom="2cm" | |||
margin-left="2.5cm" | |||
margin-right="2.5cm"> | |||
<fo:region-before extent="3cm"/> | |||
<fo:region-body margin-top="3cm"/> | |||
<fo:region-after extent="1.5cm"/> | |||
</fo:simple-page-master> | |||
</fo:layout-master-set> | |||
<!-- starts actual layout --> | |||
<fo:page-sequence> | |||
<!-- applies layout master --> | |||
<fo:sequence-specification> | |||
<fo:sequence-specifier-single page-master-name="first"/> | |||
</fo:sequence-specification> | |||
<!-- Inserts a header with the page number --> | |||
<fo:static-content flow-name="xsl-before"> | |||
<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt"> | |||
FOP - p. <fo:page-number/> | |||
</fo:block> | |||
</fo:static-content> | |||
<fo:flow flow-name="xsl-body"> | |||
<fo:block font-size="10pt" font-family="sans-serif" line-height="10pt" space-after.optimum="3pt" font-weight="bold" start-indent="15pt"> | |||
Content | |||
</fo:block> | |||
<!-- Here starts the table --> | |||
<fo:table> | |||
<fo:table-column column-width="1cm"/> | |||
<fo:table-column column-width="15cm"/> | |||
<fo:table-body font-size="10pt" font-family="sans-serif"> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">A) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">What is FOP?</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">B) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Downloading FOP</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">C) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Running FOP</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">D) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Embedding FOP </fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">E) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">What's Implemented?</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">F) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Limitations</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">G) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Bugs</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">H) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Compiling FOP</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">I) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Getting involved</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">J) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">FOP Relevant Specifications</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
<fo:table-row line-height="12pt"> | |||
<fo:table-cell> | |||
<fo:block text-align="end">K) </fo:block> | |||
</fo:table-cell> | |||
<fo:table-cell> | |||
<fo:block text-align="start">Licence</fo:block> | |||
</fo:table-cell> | |||
</fo:table-row> | |||
</fo:table-body> | |||
</fo:table> | |||
</fo:flow> | |||
</fo:page-sequence> | |||
</fo:root> |
@@ -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 |
@@ -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("<html><head><title>Test Results</title></head><body>\n"); | |||
results.println("<h2>Compare Results<br>"); | |||
results.println("<font size='1'>created " + dateTime + "</font></h2>"); | |||
results.println("<table cellpadding='10' border='2'><thead><th align='center'>reference file</th><th align='center'>test file</th>" | |||
+ "<th align='center'>identical?</th></thead>"); | |||
} | |||
//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("<tr><td><a href='" + referenceDirectory + oldFile.getName() + "'>" | |||
+ oldFile.getName() + "</a> </td><td> <a href='" | |||
+ testDirectory + newFile.getName() +"'>" | |||
+ newFile.getName() +"</a>" | |||
+ " </td><td><font color='red'>No</font></td></tr>"); | |||
} else { | |||
results.println("<tr><td><a href='" + referenceDirectory + oldFile.getName() + "'>" | |||
+ oldFile.getName() + "</a> </td><td> <a href='" | |||
+ testDirectory + newFile.getName() + "'>" | |||
+ newFile.getName() + "</a>" | |||
+ " </td><td>Yes</td></tr>"); | |||
} | |||
} | |||
} | |||
results.println("</table></html>"); | |||
} catch (IOException ioe) { | |||
System.err.println("ERROR: " + ioe); | |||
} | |||
} //end: execute() | |||
} | |||
@@ -0,0 +1,122 @@ | |||
// Ant | |||
import org.apache.tools.ant.Task; | |||
import org.apache.tools.ant.BuildException; | |||
import org.apache.fop.apps.*; | |||
// SAX | |||
import org.xml.sax.Parser; | |||
import org.xml.sax.InputSource; | |||
import org.xml.sax.SAXException; | |||
import org.xml.sax.SAXParseException; | |||
// Java | |||
import java.io.FileReader; | |||
import java.io.File; | |||
import java.io.FileWriter; | |||
import java.io.PrintWriter; | |||
import java.io.IOException; | |||
import java.io.FileNotFoundException; | |||
import java.net.URL; | |||
/* the code is adapted from Fops CommandLine class */ | |||
public class Fop { | |||
String fofile, pdffile; | |||
public void setFofile(String fofile) { | |||
this.fofile = fofile; | |||
} | |||
public void setPdffile(String pdffile) { | |||
this.pdffile = pdffile; | |||
} | |||
/** | |||
* creates a SAX parser, using the value of org.xml.sax.parser | |||
* defaulting to org.apache.xerces.parsers.SAXParser | |||
* | |||
* @return the created SAX parser | |||
*/ | |||
static Parser createParser() { | |||
String parserClassName = System.getProperty("org.xml.sax.parser"); | |||
if (parserClassName == null) { | |||
parserClassName = "org.apache.xerces.parsers.SAXParser"; | |||
} | |||
System.err.println("using SAX parser " + parserClassName); | |||
try { | |||
return (Parser) Class.forName(parserClassName).newInstance(); | |||
} catch (ClassNotFoundException e) { | |||
System.err.println("Could not find " + parserClassName); | |||
} catch (InstantiationException e) { | |||
System.err.println("Could not instantiate " + parserClassName); | |||
} catch (IllegalAccessException e) { | |||
System.err.println("Could not access " + parserClassName); | |||
} catch (ClassCastException e) { | |||
System.err.println(parserClassName + " is not a SAX driver"); | |||
} | |||
return null; | |||
} | |||
/** | |||
* create an InputSource from a file name | |||
* | |||
* @param filename the name of the file | |||
* @return the InputSource created | |||
*/ | |||
protected static InputSource fileInputSource(String filename) { | |||
/* this code adapted from James Clark's in XT */ | |||
File file = new File(filename); | |||
String path = file.getAbsolutePath(); | |||
String fSep = System.getProperty("file.separator"); | |||
if (fSep != null && fSep.length() == 1) | |||
path = path.replace(fSep.charAt(0), '/'); | |||
if (path.length() > 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"); | |||
} | |||
} | |||
@@ -9,28 +9,28 @@ | |||
* are met: | |||
* | |||
* 1. Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* 3. The end-user documentation included with the redistribution, if | |||
* any, must include the following acknowlegement: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowlegement may appear in the software itself, | |||
* if and wherever such third-party acknowlegements normally appear. | |||
* any, must include the following acknowlegement: | |||
* "This product includes software developed by the | |||
* Apache Software Foundation (http://www.apache.org/)." | |||
* Alternately, this acknowlegement may appear in the software itself, | |||
* if and wherever such third-party acknowlegements normally appear. | |||
* | |||
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software | |||
* Foundation" must not be used to endorse or promote products derived | |||
* from this software without prior written permission. For written | |||
* permission, please contact apache@apache.org. | |||
* Foundation" must not be used to endorse or promote products derived | |||
* from this software without prior written permission. For written | |||
* permission, please contact apache@apache.org. | |||
* | |||
* 5. Products derived from this software may not be called "Apache" | |||
* nor may "Apache" appear in their names without prior written | |||
* permission of the Apache Group. | |||
* nor may "Apache" appear in their names without prior written | |||
* permission of the Apache Group. | |||
* | |||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
@@ -51,12 +51,13 @@ | |||
* information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | |||
*/ | |||
//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.*; | |||
* <li>xsltfile | |||
* <li>outfile | |||
* <li>smart | |||
* <li>dependent | |||
* </ul> | |||
* <p> | |||
* Of these arguments, <b>infile, outfile</b> and <b>xsltfile</b> are required. | |||
* smart defaults to 'no'. The other allowed value is 'yes'. If smart is set to 'yes' | |||
* <p>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. | |||
* <p>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. | |||
* <p> | |||
* @author Fotis Jannidis <a href="mailto:fotis@jannidis.de">fotis@jannidis.de</a> | |||
*/ | |||
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: | |||
* <ul> | |||
* <li>yes: check whether output file is older than input or stylesheet | |||
* <li>no: (default) do conversion everytime task is called | |||
* </ul> | |||
*/ | |||
public void setSmart (String smart) { | |||
this.smart = smart; | |||
} | |||
/** | |||
* Sets the value for dependent | |||
* | |||
* @param option valid values: | |||
* <ul> | |||
* <li>none: (default) | |||
* <li>comma delimited list of files whose existence and date is checked | |||
* against the output file | |||
* </ul> | |||
*/ | |||
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: | |||
* <ul> | |||
* <li>yes: check whether output file is older than input or stylesheet | |||
* <li>no: (default) do conversion everytime task is called | |||
* </ul> | |||
*/ | |||
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(); | |||
} */ | |||
} |