*/\r
// public void execute() throws BuildException {\r
public void execute(){\r
+ try{\r
+ //Use Xerces as the parser. Does not support Saxon6.5.5 parser \r
+ System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");\r
+ System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");\r
+// System.setProperty("org.xml.sax.driver", "com.icl.saxon.aelfred.SAXDriver");\r
+// System.setProperty("javax.xml.parsers.SAXParserFactory", "com.icl.saxon.aelfred.SAXParserFactoryImpl");\r
+ } catch (SecurityException se){\r
+ System.out.println("[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 " +\r
+ "is not in your CLASSPATH.");\r
+ } catch (Exception e){\r
+ System.out.println("[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 " +\r
+ "is not in your CLASSPATH");\r
+ }\r
\r
ArrayList<DocFileInfo> filesDescription = null; // list of information about the topic files\r
ArrayList<File> htmlFiles = null; // topic files listed in the given directory\r
* Initializer\r
*/\r
public int init(String inputDir){\r
- return 0; \r
+ return 0;\r
}\r
\r
/**\r
}\r
\r
public void parseDocument (File file) {\r
+// System.out.println(System.getProperty("org.xml.sax.driver"));\r
+// System.out.println(System.getProperty("javax.xml.parsers.SAXParserFactory"));\r
+ \r
//get a factory\r
javax.xml.parsers.SAXParserFactory spf = javax.xml.parsers.SAXParserFactory.newInstance();\r
- \r
+\r
spf.setValidating(false);\r
addContent = false;\r
divCount = 0;\r
// deactivate the validation\r
sp.getXMLReader().setFeature("http://xml.org/sax/features/external-general-entities", false);\r
sp.getXMLReader().setFeature( "http://apache.org/xml/features/nonvalidating/load-external-dtd", false);\r
- //parse the file and also register this class for call backs\r
+\r
+ //parse the file and also register this class for call backs\r
System.out.println("Parsing: " + file);\r
\r
long start = System.currentTimeMillis();\r
//System.out.println("time = " + (finish - start) + " milliseconds");\r
\r
}catch(org.xml.sax.SAXException se) {\r
- System.out.println("SaxException");\r
- se.printStackTrace();\r
-\r
+ System.out.println("SaxException. You may need to include Xerces in your classpath. " +\r
+ "See documentation for details");\r
+ se.printStackTrace(); \r
}catch(javax.xml.parsers.ParserConfigurationException pce) {\r
pce.printStackTrace();\r
}catch (IOException ie) {\r
ie.printStackTrace();\r
}\r
}\r
- //kasun: TODO remove indexing of css styles\r
+ \r
private boolean addContent = false;\r
private boolean addHeaderInfo = false;\r
private boolean doNotIndex=false;\r