P
Pascal Lagass?
Hi,
Environment: Java 1.4.1_02
OS: Windows 2000
XML-Parse: Xerces-J 2.6.0
The following snipplet functions without problem with a filename, only
with standard ASCII characters (like: file.xml ...).
The XML processing job is done as it should be:
------------------------ SNIPPLET --------------------------
import org.apache.xerces.parsers.SAXParser;
....
public class mySaX {
private mySaxContentHandler m_wch;
public void parse(String uri) {
ContentHandler contentHandler = new mySaxContentHandler();
try {
XMLReader parser = new SAXParser();
parser.setContentHandler(contentHandler);
m_wch = (mySaxContentHandler) contentHandler;
parser.parse(uri);
...
} catch (IOException e) {
System.out.println("Fehler beim Lesen des URI: " + uri + " "+
e.getMessage());
} catch (SAXException e) {
System.out.println("Fehler beim Parsen: " + e.getMessage());
}
}
------------------------END SNIPPLET --------------------------
But, when I am using a filename with a name like "para_grisé.xml",
then I got:
------------------------- ERROR MESSAGE -------------------
Fehler beim Lesen des URI: para_grisÚ.xml unknown protocol: e
------------------------- END ERROR MESSAGE ---------------
I never encountered a problem with this before, when using a File
Object or when displaying the name with a SWING component.
Does anybody have encountered the same problem before? How should I
reencode the URI for the parsing?
Thank you very much in advance,
/Pascal Lagassé
Kösel GmbH & Co. KG - Über 400 Jahre Bücher mit System
Wartenseestraße 11 87435 Kempten
http://www.koeselbuch.de mailto[email protected]
Environment: Java 1.4.1_02
OS: Windows 2000
XML-Parse: Xerces-J 2.6.0
The following snipplet functions without problem with a filename, only
with standard ASCII characters (like: file.xml ...).
The XML processing job is done as it should be:
------------------------ SNIPPLET --------------------------
import org.apache.xerces.parsers.SAXParser;
....
public class mySaX {
private mySaxContentHandler m_wch;
public void parse(String uri) {
ContentHandler contentHandler = new mySaxContentHandler();
try {
XMLReader parser = new SAXParser();
parser.setContentHandler(contentHandler);
m_wch = (mySaxContentHandler) contentHandler;
parser.parse(uri);
...
} catch (IOException e) {
System.out.println("Fehler beim Lesen des URI: " + uri + " "+
e.getMessage());
} catch (SAXException e) {
System.out.println("Fehler beim Parsen: " + e.getMessage());
}
}
------------------------END SNIPPLET --------------------------
But, when I am using a filename with a name like "para_grisé.xml",
then I got:
------------------------- ERROR MESSAGE -------------------
Fehler beim Lesen des URI: para_grisÚ.xml unknown protocol: e
------------------------- END ERROR MESSAGE ---------------
I never encountered a problem with this before, when using a File
Object or when displaying the name with a SWING component.
Does anybody have encountered the same problem before? How should I
reencode the URI for the parsing?
Thank you very much in advance,
/Pascal Lagassé
Kösel GmbH & Co. KG - Über 400 Jahre Bücher mit System
Wartenseestraße 11 87435 Kempten
http://www.koeselbuch.de mailto[email protected]