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

Norrman Per per.norrman at canovia.se
Tue Dec 17 00:17:45 PST 2002


 
Have a look at builder#setEntityResolver

/pmn


-----Original Message-----
From: Zhong, Kai
To: 'jdom-interest at jdom.org'
Sent: 2002-12-17 01:47
Subject: [jdom-interest] how to set xml files base uri

Hi, I have an message driven bean and it will read an xml file from file
system.
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.

Kai.
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
rhost.com
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/



More information about the jdom-interest mailing list