Kleber, 

Como eu lhe mostrei no �ltimo email, ao fazer uso do m�todo 
XMLReaderFactory.createXMLReader() este procura por uma propriedade do 
sistema chamada �org.xml.sax.driver�. Se essa vari�vel n�o for definida 
(geralmente n�o �) internamente a API vai retornar null. Consequentemente 
vai gerar um SAXException... Tente usar o m�todo passando como argumento o 
parser que voc� deseja usar (abordagem muito boa se vc n�o usa o parser SAX 
da API JAXP). Se vc quiser usar a API JAXP fa�a algo parecido como o trecho 
abaixo: 

SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
saxParser.parse( new File(argv[0]), handler ); 


Apesar se ser mais simples vamos sempre utilizar o mesmo parser. Neste seu 
caso � o que vem com jsdk 1.4.0... Tente fazer um c�digo independente do 
parser que vc vai precisar. Sendo assim, a abordagem com o uso do 
XMLReaderFactory � muito boa... 

Abra�os,
Jeferson Alexander 

 


>           
>     try {
>       XMLReader parser =
> XMLReaderFactory.createXMLReader();
>       
>       // Since this just writes onto the console, it's
> best
>       // to use the system default encoding, which is
> what
>       // we get by not specifying an explicit encoding
> here.
>       Writer out = new OutputStreamWriter(System.out);
>       ContentHandler handler = new TextExtractor(out);
>       parser.setContentHandler(handler);
>     
>       parser.parse(args[0]);
>       
>       out.flush();
>     }
>     catch (Exception e) {
>       System.err.println(e); 
>     }

___________________________________________________________________________ 

Jeferson Alexander                           _/_/_/_/  _/    _/  _/    _/
PS Consultant                               _/        _/    _/  _/_/  _/
Professional Services                      _/_/_/_/  _/    _/  _/ _/ _/
SUN MICROSYSTEMS DO BRASIL - BSB                _/  _/    _/  _/  _/_/
Tel: +55 61 99887769                     _/_/_/_/  _/_/_/_/  _/    _/
e-mail: [EMAIL PROTECTED]    M I C R O S Y S T E M S
http://www.sun.com.br
___________________________________________________________________________ 

---------------------------------------------------------------------
Para cancelar a subscri��o, envie mensagem para: 
[EMAIL PROTECTED]
Para comandos adicionais, envie mensagem para: [EMAIL PROTECTED]

Responder a