From: fotis Date: Sat, 15 Jul 2000 11:37:05 +0000 (+0000) Subject: set SAX 2 feature namespace-prefix to true X-Git-Tag: pre-columns~372 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8190c107c04cbb5904056a2c9a9fb09fcb5c95fd;p=xmlgraphics-fop.git set SAX 2 feature namespace-prefix to true git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193505 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/apps/AWTCommandLine.java b/src/org/apache/fop/apps/AWTCommandLine.java index ca224ee63..de3c870e5 100644 --- a/src/org/apache/fop/apps/AWTCommandLine.java +++ b/src/org/apache/fop/apps/AWTCommandLine.java @@ -70,12 +70,19 @@ public class AWTCommandLine { frame.progress(resource.getString("Init parser") + " ..."); XMLReader parser = createParser(); - if (parser == null) { MessageHandler.errorln("ERROR: Unable to create SAX parser"); System.exit(1); } + // setting the necessary parser features + try { + parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + } catch (SAXException e) { + MessageHandler.errorln("Error in setting up parser feature namespace-prefixes"); + MessageHandler.errorln("You need a parser which supports SAX version 2"); + System.exit(1); + } try { Driver driver = new Driver(); diff --git a/src/org/apache/fop/apps/CommandLine.java b/src/org/apache/fop/apps/CommandLine.java index 270b4a5f7..f0916812f 100644 --- a/src/org/apache/fop/apps/CommandLine.java +++ b/src/org/apache/fop/apps/CommandLine.java @@ -48,6 +48,8 @@ Software Foundation, please see . */ + + package org.apache.fop.apps; // SAX @@ -155,13 +157,22 @@ public class CommandLine { } XMLReader parser = createParser(); - + if (parser == null) { MessageHandler.errorln("ERROR: Unable to create SAX parser"); System.exit(1); } - try { + // setting the parser features + try { + parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + } catch (SAXException e) { + MessageHandler.errorln("Error in setting up parser feature namespace-prefixes"); + MessageHandler.errorln("You need a parser which supports SAX version 2"); + System.exit(1); + } + + try { Driver driver = new Driver(); driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version); driver.addElementMapping("org.apache.fop.fo.StandardElementMapping"); diff --git a/src/org/apache/fop/apps/PrintCommandLine.java b/src/org/apache/fop/apps/PrintCommandLine.java index 9f9be920d..c9f620686 100755 --- a/src/org/apache/fop/apps/PrintCommandLine.java +++ b/src/org/apache/fop/apps/PrintCommandLine.java @@ -51,12 +51,20 @@ public class PrintCommandLine extends CommandLine { } XMLReader parser = createParser(); - + if (parser == null) { MessageHandler.errorln("ERROR: Unable to create SAX parser"); System.exit(1); } + // setting the necessary parser features + try { + parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + } catch (SAXException e) { + MessageHandler.errorln("Error in setting up parser feature namespace-prefixes"); + MessageHandler.errorln("You need a parser which supports SAX version 2"); + } + PrintRenderer renderer = new PrintRenderer(); try { Driver driver = new Driver();