Hi folks,


I have a question on “correct” behavior of SAX parsers. Say you have a directory with 2 files in it: doc.xml and doc.dtd. Doc.xml looks like this:


<!DOCTYPE doc SYSTEM "doc.dtd">



What should the following Java code do if run in the same directory as doc.xml and doc.dtd? Should it be able to find doc.dtd?


Case 1 – SAX2:

XMLReader reader = …;

reader.parse(new InputSource(new FileInputStream(“doc.xml”)));


Case 2 – JAXP:

SAXParser parser = ...;

parser.parse(new FileInputStream(“doc.xml”), new DefaultHandler());


Different parsers seem to exhibit different behavior. Piccolo currently doesn’t find the file in either case, since it doesn’t assume a base URI. Should I change this?