diff options
author | Andreas Bille <abi@openoffice.org> | 2001-02-05 08:23:25 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2001-02-05 08:23:25 +0000 |
commit | fda69711ad200464cd1f4c6544c04aa89b63542d (patch) | |
tree | 00853f72dd538d9e2af9e32fad67cc6ec8929f1c /xmlhelp | |
parent | c803846f0e3fac6f513c17d5881f3acfaf4e1fe8 (diff) |
#82035#
Partly fixed, new tooling
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/com/sun/star/help/HelpIndexer.java | 79 | ||||
-rw-r--r-- | xmlhelp/source/com/sun/star/help/makefile.mk | 7 |
2 files changed, 41 insertions, 45 deletions
diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java index 095dff9ab17d..e86096c1bf6a 100644 --- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java +++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java @@ -598,86 +598,71 @@ public class HelpIndexer { private final OutputMethodHandlerImpl _output; - // Same as below from URL - - public ParseStuff( String styleSheet, boolean any ) - { + private ParseStuff() + { _processor = new XSLProcessorImpl(); + + // Determine the parser SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setValidating( false ); - Parser _parser = null; try { - SAXParser sp = spf.newSAXParser(); - _parser = sp.getParser(); - + _processor.setParser( spf.newSAXParser().getParser() ); } catch( java.lang.Exception e ) { - System.out.println( "<!-- NO HELP AVAILABLE: no parser found -->" ); + System.err.println( "<!-- NO HELP AVAILABLE: no parser found -->" ); System.exit( 1 ); } - _processor.setParser( _parser ); + // Determine the OutputMethodHandler _output = new OutputMethodHandlerImpl( _processor ); _processor.setOutputMethodHandler( _output ); + } + // Loading from a URL + public ParseStuff( URL url ) + { + this(); try { - _processor.loadStylesheet( new InputSource( styleSheet ) ); + _processor.loadStylesheet( new InputSource( url.toExternalForm() ) ); } catch( SAXException e ) { - System.out.println( "<!-- Syntactic error in stylesheet -->" ); + System.err.println( "<!-- Syntactic error in stylesheet -->" ); + System.err.println( e.getMessage() ); System.exit( 1 ); } catch( java.io.IOException e ) { - System.out.println( "<!-- Style sheet not found: " + styleSheet + " -->" ); + System.err.println( "<!-- Style sheet not found -->" ); + System.err.println( e.getMessage() ); System.exit( 1 ); } + System.out.println( "Using stylesheet: " + url.toExternalForm() ); } - - - + // Loading from a file public ParseStuff( String styleSheet ) { - _processor = new XSLProcessorImpl(); - SAXParserFactory spf = SAXParserFactory.newInstance(); - spf.setValidating( false ); - Parser _parser = null; - try - { - SAXParser sp = spf.newSAXParser(); - _parser = sp.getParser(); - - } - catch( java.lang.Exception e ) - { - System.out.println( "<!-- NO HELP AVAILABLE: no parser found -->" ); - System.exit( 1 ); - } - - _processor.setParser( _parser ); - _output = new OutputMethodHandlerImpl( _processor ); - _processor.setOutputMethodHandler( _output ); - + this(); try { _processor.loadStylesheet( new InputSource( new FileInputStream( styleSheet ) ) ); } catch( SAXException e ) { - System.out.println( "<!-- Syntactic error in stylesheet -->" ); + System.err.println( "<!-- Syntactic error in stylesheet -->" ); System.exit( 1 ); } catch( java.io.IOException e ) { - System.out.println( "<!-- Style sheet not found: " + styleSheet + " -->" ); + System.err.println( "<!-- Style sheet not found: -->" ); System.exit( 1 ); } + System.out.println( "Using stylesheet: " + styleSheet ); } @@ -690,7 +675,8 @@ public class HelpIndexer { HelpOutputStream _out = new HelpOutputStream(); try { - OutputStreamDestination _dest = new OutputStreamDestination( _out ); + // OutputStreamDestination _dest = new OutputStreamDestination( _out ); + HelpProvider.ProviderDestination _dest = new HelpProvider.ProviderDestination( _out,"UTF-8" ); synchronized( this ) { _output.setDestination( _dest ); @@ -700,11 +686,20 @@ public class HelpIndexer { } catch( java.io.IOException e ) { - System.out.println( "no file corresponding to URL exists, but I don't tell you what the URL is ..." ); + System.err.println( "no file corresponding to URL exists: " + url ); + System.err.println( "no file corresponding to URL exists: " + e.getMessage() ); + // System.exit( 1 ); } catch( SAXException e ) { - System.out.println( "ill formed xml document: " + e.getMessage() ); + System.err.println( "ill formed xml document: " + e.getMessage() ); + System.err.println( " url: " + url ); + // System.exit( 1 ); + } + catch( Exception e ) + { + System.err.println( "any other exception" ); + System.err.println( e.getMessage() ); } return _out.getBigBuffer(); @@ -715,8 +710,8 @@ public class HelpIndexer { { _processor.setParameter( key,value ); } - } // end class ParseStuff + } // end class ParseStuff diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk index 47c60a6f3134..8d7c23506163 100644 --- a/xmlhelp/source/com/sun/star/help/makefile.mk +++ b/xmlhelp/source/com/sun/star/help/makefile.mk @@ -3,9 +3,9 @@ #* $Workfile:$ #* #* Creation date KR 28.06.99 -#* last change $Author: mt $ $Date: 2000-12-15 09:11:20 $ +#* last change $Author: abi $ $Date: 2001-02-05 09:23:25 $ #* -#* $Revision: 1.10 $ +#* $Revision: 1.11 $ #* #* $Logfile:$ #* @@ -65,7 +65,8 @@ JAVACLASSFILES = \ $(CLASSDIR)$/$(PACKAGE)$/HelpResultSet.class \ $(CLASSDIR)$/$(PACKAGE)$/HelpResultSetForRoot.class \ $(CLASSDIR)$/$(PACKAGE)$/HelpIndexer.class \ - $(CLASSDIR)$/$(PACKAGE)$/PreTransformer.class \ + $(CLASSDIR)$/$(PACKAGE)$/HelpTransformer.class \ + $(CLASSDIR)$/$(PACKAGE)$/HelpPackager.class \ $(CLASSDIR)$/$(PACKAGE)$/CreateDb.class \ $(CLASSDIR)$/$(PACKAGE)$/XSLData.class \ $(CLASSDIR)$/$(PACKAGE)$/StringDbt.class |