You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/02/11 11:01:29 UTC
DO NOT REPLY [Bug 6361] New: -
Problem with wrong URI
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6361>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6361
Problem with wrong URI
Summary: Problem with wrong URI
Product: Xerces-J
Version: 1.4.3
Platform: PC
OS/Version: Windows 9x
Status: NEW
Severity: Major
Priority: Other
Component: SAX
AssignedTo: xerces-j-dev@xml.apache.org
ReportedBy: Dirk.Weirowski@gmx.de
Hi,
i make my first steps with Java and XML. I have entered the following example
and complied it. To execute it I entered:
java SAXParserDemo file://c:/JavaXML/Kapitel03/contents.xml ( wrong URI:
file:///c:...
The program starts to parse, but it does not terminate.
If you use the correct URI there is no problem.
Best regards,
Dirk
// SAXParserDemo.java
import java.io.IOException;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
// Importieren Sie hier die XMLReader-Implementation Ihres Herstellers
import org.apache.xerces.parsers.SAXParser;
/**
* <b><code>SAXParserDemo</code></b> erwartet eine XML-Datei und parst die
* mittels SAX; dabei werden die Callbacks im Parsing-Lebenszyklus angezeigt.
*
* @author
* <a href="mailto:brettmclaughlin@earthlink.net">Brett McLaughlin</a>
* @version 1.0
*/
public class SAXParserDemo {
/**
* <p>
* Hier wird die Datei mit registrierten SAX-Handlern geparst,
* und die Ereignisse werden im Parsing-Vorgang ausgegeben.
* </p>
*
* @param uri <code>String</code> URI der zu parsenden Datei.
*/
public void performDemo(String uri) {
System.out.println("XML-Datei wird geparst: " + uri + "\n\n");
try {
// Einen Parser instanzieren
XMLReader parser = new SAXParser();
// Das Dokument parsen
parser.parse(uri);
} catch (IOException e) {
System.out.println("Fehler beim Lesen der URI: " +
e.getMessage());
} catch (SAXException e) {
System.out.println("Fehler beim Parsen: " + e.getMessage
());
}
}
/**
* <p>
* Ein Kommandozeilen-Einstiegspunkt f�r dieses Demoprogramm.
* </p>
*/
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Aufruf: java SAXParserDemo [XML
URI]");
System.exit(0);
}
String uri = args[0];
SAXParserDemo parserDemo = new SAXParserDemo();
parserDemo.performDemo(uri);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org