Hiho, I'm fairly new to the use of dom4j (using 1.5 beta1) and get the following exception while parsing an xml File, read via ClassLoader.getSystemResourceAsStream( ... )
org.xml.sax.SAXParseException: Relative URI "Templatedatei.dtd"; kann nicht ohne eine Basis-URI aufgelöst werden. at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339) at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3333) at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2915) at org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2887) at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1276) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:623) at org.apache.crimson.parser.Parser2.parse(Parser2.java:333) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.dom4j.io.SAXReader.read(SAXReader.java:323) ... These are the first few line of my XML File: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE NachrichtenTemplates SYSTEM "Templatedatei.dtd"> <NachrichtenTemplates> <Template> ... The XML file is valid. *snip - part of code* try { SAXReader reader = new SAXReader(); reader.setIncludeExternalDTDDeclarations( false ); reader.setEntityResolver( new EntityResolver() { public InputSource resolveEntity( String publicID, String systemID ) { log.info( "please resolve me: " + publicID + ":" + systemID ); if( systemID.indexOf( "Templatedatei.dtd" ) != -1 ) { log.info( "Externe Templatedatei.dtd identifiziert: \"" + systemID + "\", lade interne Templatedatei.dtd aus SystemRessources" ); return new InputSource( ClassLoader.getSystemResourceAsStream( "configuration/dtd/Templatedatei.dtd" ) ); } log.error( "Unbekannte Entity \"" + systemID + "\"" ); throw new RuntimeException(); } }); document = reader.read( ClassLoader.getSystemResourceAsStream( "configuration/Templates.xml" ) ); ... * snip - end of code * My entity resolver never gets used. Can anyone help me with this one? Or maybe just give me a pointer where this has been discussed before? Thanks very much. -- In diesem Sinne, Olav ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user