Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.89 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Sax - ExpatParser$ParseException
  2. public LectorSAX(String url){
  3.     try{
  4.         SAXParserFactory spf=SAXParserFactory.newInstance();
  5.         SAXParser sp = spf.newSAXParser();
  6.         DefaultHandler lxmlr=new LibraryXMLReader() ;
  7.         sp.parse(url, lxmlr);
  8.  
  9.         nodo=((LibraryXMLReader)lxmlr).getNodoActual();
  10.  
  11.     }catch(ParserConfigurationException e){
  12.         System.err.println("Error de parseo en LectorSAX.java: "+e);
  13.     }catch(SAXException e){
  14.         System.err.println("Error de sax LectorSAX.java: " + e);
  15.     } catch (IOException e){
  16.         System.err.println("Error de  io LectorSAX.java: " + e);
  17.     }
  18. }
  19.        
  20. SAXParserFactory factory = SAXParserFactory.newInstance();
  21. SAXParser parser = factory.newSAXParser();
  22.  
  23. InputSource is = new InputSource(url);
  24. is.setEncoding("ISO-8859-15");
  25.  
  26. DefaultHandler lxmlr=new LibraryXMLReader() ;
  27. sp.parse(is, lxmlr);
  28.        
  29. is.setEncoding("ISO-8859-1");