Code example for XMLReader

Methods: parsesetContentHandler

0
       try { 
          SAXParser saxParser = saxFactory.newSAXParser();
          XMLReader sheetParser = saxParser.getXMLReader();
          ContentHandler handler = new XSSFSheetXMLHandler(
                styles, strings, sheetContentsExtractor, formatter, formulasNotResults);
          sheetParser.setContentHandler(handler);
          sheetParser.parse(sheetSource);
       } catch(ParserConfigurationException e) {
          throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
       } 
   } 
 
   /** 
    * Processes the file and returns the text 
    */ 
   public String getText() {
       try { 
          ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(container);
          XSSFReader xssfReader = new XSSFReader(container);
          StylesTable styles = xssfReader.getStylesTable();
Stop searching for code, let great code find you!  Add Codota to your java IDE