[jdom-interest] how to set xml files base uri

Zhong, Kai Kai.Zhong at t-t.com
Mon Dec 16 16:47:57 PST 2002

Hi, I have an message driven bean and it will read an xml file from file
e.g. 		Document doc = builder.build(new FileReader(docID ".xml"));
However, inside the docid.xml, there is a a dtd reference:
<!DOCTYPE trang SYSTEM "/dtd_files/trang.dtd">
which is a relative path. It is physically located under c:/dtd_files

When the EJB runs, it raises an exception:
[STDERR] Error on line 2: Relative URI "/dtd_files/trang.dtd; can not be
resolved without a document URI.

The problem is how to set the uri? I tried:
Document doc = builder.build(new FileReader(docID ".xml"), "file:/c:/");

But it doesn't work.

Thanks for your help.


More information about the jdom-interest mailing list