aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-07-19 22:46:14 +0000
committerGlen Mazza <gmazza@apache.org>2004-07-19 22:46:14 +0000
commitb1c93550a81a4fe1efdb21767913b52b2bf41d79 (patch)
tree22dd8de3a810a898e14b2ca93d824042271f67df /examples
parentaf81f828c5b7a480bf9d0674bbfefb9a60524ac5 (diff)
downloadxmlgraphics-fop-b1c93550a81a4fe1efdb21767913b52b2bf41d79.tar.gz
xmlgraphics-fop-b1c93550a81a4fe1efdb21767913b52b2bf41d79.zip
1.) Moved exclusively to Simon's DefaultHandler object for both Transformer
and SAXParser usage. DefaultHandler implements the ContentHandler interface so it can be used where the latter was previously used, also it provides more functionality. [1] 2.) Updated the examples and internal code accordingly. 3.) Renamed ExampleFO2PDFUsingSAX to ...Parser to avoid confusion (both use SAX.) [1] http://www.cafeconleche.org/books/xmljava/chapters/ch06s03.html#d0e8440 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197802 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples')
-rw-r--r--examples/embedding/build.xml2
-rw-r--r--examples/embedding/java/embedding/ExampleDOM2PDF.java2
-rw-r--r--examples/embedding/java/embedding/ExampleFO2PDF.java2
-rw-r--r--examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java (renamed from examples/embedding/java/embedding/ExampleFO2PDFUsingSAX.java)8
-rw-r--r--examples/embedding/java/embedding/ExampleObj2PDF.java2
-rw-r--r--examples/embedding/java/embedding/ExampleXML2PDF.java2
6 files changed, 9 insertions, 9 deletions
diff --git a/examples/embedding/build.xml b/examples/embedding/build.xml
index ec382aceb..11d803c09 100644
--- a/examples/embedding/build.xml
+++ b/examples/embedding/build.xml
@@ -86,7 +86,7 @@
</target>
<target name="example2" depends="compile" description="Runs the FO to PDF example using a SAXParser">
<echo message="Running the FO to PDF example using a SAXParser"/>
- <java classname="${name}.ExampleFO2PDFUsingSAX" fork="yes">
+ <java classname="${name}.ExampleFO2PDFUsingSAXParser" fork="yes">
<classpath>
<path refid="project.class.path"/>
<pathelement location="${build.dest}"/>
diff --git a/examples/embedding/java/embedding/ExampleDOM2PDF.java b/examples/embedding/java/embedding/ExampleDOM2PDF.java
index 0612178e9..372ff274a 100644
--- a/examples/embedding/java/embedding/ExampleDOM2PDF.java
+++ b/examples/embedding/java/embedding/ExampleDOM2PDF.java
@@ -79,7 +79,7 @@ public class ExampleDOM2PDF {
Source src = new DOMSource(xslfoDoc);
// Resulting SAX events (the generated FO) must be piped through to FOP
- Result res = new SAXResult(driver.getContentHandler());
+ Result res = new SAXResult(driver.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
diff --git a/examples/embedding/java/embedding/ExampleFO2PDF.java b/examples/embedding/java/embedding/ExampleFO2PDF.java
index 281bbf02d..2cac20729 100644
--- a/examples/embedding/java/embedding/ExampleFO2PDF.java
+++ b/examples/embedding/java/embedding/ExampleFO2PDF.java
@@ -72,7 +72,7 @@ public class ExampleFO2PDF {
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
- Result res = new SAXResult(driver.getContentHandler());
+ Result res = new SAXResult(driver.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
diff --git a/examples/embedding/java/embedding/ExampleFO2PDFUsingSAX.java b/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java
index 74645c3a4..de152b125 100644
--- a/examples/embedding/java/embedding/ExampleFO2PDFUsingSAX.java
+++ b/examples/embedding/java/embedding/ExampleFO2PDFUsingSAXParser.java
@@ -43,7 +43,7 @@ import org.apache.fop.apps.FOPException;
* This class demonstrates the conversion of an FO file to PDF using FOP.
* It uses a SAXParser with FOP as the DefaultHandler
*/
-public class ExampleFO2PDFUsingSAX {
+public class ExampleFO2PDFUsingSAXParser {
/**
* Converts an FO file to a PDF file using FOP
@@ -99,7 +99,7 @@ public class ExampleFO2PDFUsingSAX {
*/
public static void main(String[] args) {
try {
- System.out.println("FOP ExampleFO2PDFUsingSAX\n");
+ System.out.println("FOP ExampleFO2PDFUsingSAXParser\n");
System.out.println("Preparing...");
//Setup directories
@@ -109,14 +109,14 @@ public class ExampleFO2PDFUsingSAX {
//Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
- File pdffile = new File(outDir, "ResultFO2PDFUsingSAX.pdf");
+ File pdffile = new File(outDir, "ResultFO2PDFUsingSAXParser.pdf");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("Transforming...");
- ExampleFO2PDFUsingSAX app = new ExampleFO2PDFUsingSAX();
+ ExampleFO2PDFUsingSAXParser app = new ExampleFO2PDFUsingSAXParser();
app.convertFO2PDF(fofile, pdffile);
System.out.println("Success!");
diff --git a/examples/embedding/java/embedding/ExampleObj2PDF.java b/examples/embedding/java/embedding/ExampleObj2PDF.java
index d41c51d9e..e68bc69c8 100644
--- a/examples/embedding/java/embedding/ExampleObj2PDF.java
+++ b/examples/embedding/java/embedding/ExampleObj2PDF.java
@@ -72,7 +72,7 @@ public class ExampleObj2PDF {
Source src = team.getSourceForProjectTeam();
// Resulting SAX events (the generated FO) must be piped through to FOP
- Result res = new SAXResult(driver.getContentHandler());
+ Result res = new SAXResult(driver.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
diff --git a/examples/embedding/java/embedding/ExampleXML2PDF.java b/examples/embedding/java/embedding/ExampleXML2PDF.java
index a1dea46fe..fa99b843e 100644
--- a/examples/embedding/java/embedding/ExampleXML2PDF.java
+++ b/examples/embedding/java/embedding/ExampleXML2PDF.java
@@ -87,7 +87,7 @@ public class ExampleXML2PDF {
Source src = new StreamSource(xmlfile);
// Resulting SAX events (the generated FO) must be piped through to FOP
- Result res = new SAXResult(driver.getContentHandler());
+ Result res = new SAXResult(driver.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);