You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jordan C N Chong <ch...@cs.utwente.nl> on 2001/11/14 16:06:08 UTC

File Not Foud for parsing?

Dear all,

I have this very strange problem. I have the following code:

public class DOM
{
	public static void main (String[] args)
		throws Exception
	{
		String role = null;
		Vector rights = null;
		if (args.length != 1) {
			System.err.println("Missing filename.");
			System.exit(1);
		}
		DOMParser parser = new DOMParser();
		parser.parse(args[0]);
		Document doc = parser.getDocument();
		for (Node child = doc.getDocumentElement().getFirstChild();
			 child != null;
			......

}

I am pretty sure the XML file is in the same directory as the class file.
So, when I type
java DOM test.xml

The SAXException of File not found happens.

I even tried
java DOM "C:\location of the file\test.xml"

The same problem happens. Did I do something wrong in the code? Or... I miss
something here? Please help. Thank you very much.


Best regards,
Jordan


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org