import java.awt.*;
// SAX
-import org.xml.sax.Parser;
+import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
//init parser
frame.progress(resource.getString("Init parser") + " ...");
- Parser parser = createParser();
+ XMLReader parser = createParser();
if (parser == null) {
}
- static Parser createParser() {
+ static XMLReader createParser() {
String parserClassName =
System.getProperty("org.xml.sax.parser");
if (parserClassName == null) {
- parserClassName = "com.jclark.xml.sax.Driver";
+ parserClassName = "org.apache.xerces.parsers.SAXParser";
}
MessageHandler.errorln("using SAX parser " + parserClassName);
try {
- return (Parser)
+ return (XMLReader)
Class.forName(parserClassName).newInstance();
} catch (ClassNotFoundException e) {
MessageHandler.errorln("Could not find " + parserClassName);
import java.io.*;
// FOP
-import org.apache.fop.fo.FOTreeBuilder;
-import org.apache.fop.fo.ElementMapping;
+import org.apache.fop.fo.XTFOTreeBuilder;
+import org.apache.fop.fo.XTElementMapping;
import org.apache.fop.layout.AreaTree;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.render.Renderer;
* to your stylesheet. Now XT will automatically call FOP.
*
*/
-public class PDFOutputHandler extends FOTreeBuilder implements OutputDocumentHandler {
+public class PDFOutputHandler extends XTFOTreeBuilder implements OutputDocumentHandler {
/** the area tree that is the result of formatting the FO tree */
protected AreaTree areaTree;
*
* an element mapping maps element names to Java classes
*/
- public void addElementMapping(ElementMapping mapping) {
+ public void addElementMapping(XTElementMapping mapping) {
mapping.addToBuilder(this);
}
* protected method used by addElementMapping(String) to
* instantiate element mapping class
*/
- protected ElementMapping createElementMapping(String mappingClassName) {
+ protected XTElementMapping createElementMapping(String mappingClassName) {
MessageHandler.logln("using element mapping " + mappingClassName);
try {
- return (ElementMapping)
+ return (XTElementMapping)
Class.forName(mappingClassName).newInstance();
} catch (ClassNotFoundException e) {
MessageHandler.errorln("Could not find " + mappingClassName);
*/
-import org.xml.sax.Parser;
+import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
System.exit(1);
}
- Parser parser = createParser();
+ XMLReader parser = createParser();
if (parser == null) {
MessageHandler.errorln("ERROR: Unable to create SAX parser");